@novu/framework 2.11.2-alpha.0 → 2.11.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/{agent.types-DdgaVUb7.d.cts → agent.types-Dqm2VBTO.d.cts} +56 -2
  2. package/dist/cjs/ai-sdk/index.cjs +1 -1
  3. package/dist/cjs/ai-sdk/index.d.cts +2 -1
  4. package/dist/cjs/{health-check.types-CkUmYLNG.d.cts → health-check.types-B9FbzRbm.d.cts} +2 -2
  5. package/dist/cjs/{index-BCp3U0UG.d.cts → index-1DobCKAF.d.cts} +4 -33
  6. package/dist/cjs/index.cjs +72 -72
  7. package/dist/cjs/index.d.cts +4 -4
  8. package/dist/cjs/internal/index.cjs +1 -1
  9. package/dist/cjs/internal/index.d.cts +7 -5
  10. package/dist/cjs/langchain/index.cjs +1 -1
  11. package/dist/cjs/langchain/index.d.cts +2 -1
  12. package/dist/cjs/servers/express.cjs +86 -86
  13. package/dist/cjs/servers/express.d.cts +5 -5
  14. package/dist/cjs/servers/h3.cjs +93 -93
  15. package/dist/cjs/servers/h3.d.cts +5 -5
  16. package/dist/cjs/servers/lambda.cjs +72 -72
  17. package/dist/cjs/servers/lambda.d.cts +5 -5
  18. package/dist/cjs/servers/nest.cjs +105 -105
  19. package/dist/cjs/servers/nest.d.cts +7 -7
  20. package/dist/cjs/servers/next.cjs +86 -86
  21. package/dist/cjs/servers/next.d.cts +5 -5
  22. package/dist/cjs/servers/nuxt.cjs +93 -93
  23. package/dist/cjs/servers/nuxt.d.cts +5 -5
  24. package/dist/cjs/servers/remix.cjs +86 -86
  25. package/dist/cjs/servers/remix.d.cts +5 -5
  26. package/dist/cjs/servers/sveltekit.cjs +91 -91
  27. package/dist/cjs/servers/sveltekit.d.cts +5 -5
  28. package/dist/cjs/step-resolver.cjs +1 -1
  29. package/dist/cjs/step-resolver.d.cts +2 -2
  30. package/dist/cjs/{subscriber.types-DxMMRBIi.d.cts → subscriber.types-DubxcL8q.d.cts} +16 -0
  31. package/dist/cjs/validators.cjs +1 -1
  32. package/dist/esm/{agent.types-Bu3DhlVb.d.ts → agent.types-E3sxq6xr.d.ts} +56 -2
  33. package/dist/esm/ai-sdk/index.d.ts +2 -1
  34. package/dist/esm/ai-sdk/index.js +1 -1
  35. package/dist/esm/{chunk-DKQLYSZS.js → chunk-22DBAEUX.js} +1 -1
  36. package/dist/esm/{chunk-QTWEINJ4.js → chunk-CANJPWLT.js} +1 -1
  37. package/dist/esm/chunk-E2MET7IR.js +1 -0
  38. package/dist/esm/chunk-Q6BV36LU.js +98 -0
  39. package/dist/esm/{health-check.types-nDCnGlmX.d.ts → health-check.types-BNocZ4Wk.d.ts} +2 -2
  40. package/dist/esm/{index-DEehllqa.d.ts → index-aVljLqR4.d.ts} +4 -33
  41. package/dist/esm/index.d.ts +4 -4
  42. package/dist/esm/index.js +1 -1
  43. package/dist/esm/internal/index.d.ts +7 -5
  44. package/dist/esm/internal/index.js +1 -1
  45. package/dist/esm/langchain/index.d.ts +2 -1
  46. package/dist/esm/langchain/index.js +1 -1
  47. package/dist/esm/servers/express.d.ts +5 -5
  48. package/dist/esm/servers/express.js +1 -1
  49. package/dist/esm/servers/h3.d.ts +5 -5
  50. package/dist/esm/servers/h3.js +1 -1
  51. package/dist/esm/servers/lambda.d.ts +5 -5
  52. package/dist/esm/servers/lambda.js +1 -1
  53. package/dist/esm/servers/nest.d.ts +7 -7
  54. package/dist/esm/servers/nest.js +1 -1
  55. package/dist/esm/servers/next.d.ts +5 -5
  56. package/dist/esm/servers/next.js +1 -1
  57. package/dist/esm/servers/nuxt.d.ts +5 -5
  58. package/dist/esm/servers/nuxt.js +1 -1
  59. package/dist/esm/servers/remix.d.ts +5 -5
  60. package/dist/esm/servers/remix.js +1 -1
  61. package/dist/esm/servers/sveltekit.d.ts +5 -5
  62. package/dist/esm/servers/sveltekit.js +1 -1
  63. package/dist/esm/step-resolver.d.ts +2 -2
  64. package/dist/esm/step-resolver.js +1 -1
  65. package/dist/esm/{subscriber.types-BbyO_Cz6.d.ts → subscriber.types-CmybpXhA.d.ts} +16 -0
  66. package/dist/esm/validators.js +1 -1
  67. package/package.json +2 -2
  68. package/dist/esm/chunk-KLIOXJR3.js +0 -1
  69. package/dist/esm/chunk-YF62BBGH.js +0 -98
@@ -1,10 +1,10 @@
1
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
2
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
3
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
4
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
1
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
2
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
3
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
4
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
5
5
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
6
6
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
7
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
7
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
8
8
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
9
9
  import '../util.types-DaFfsxgy.js';
10
10
  import '../base.schema.types-BApIn9jr.js';
@@ -1 +1 @@
1
- import{b as x,c as a,d as N,e as b}from"../chunk-YF62BBGH.js";import{a as y,b as h,c,d as m,e as f,f as H,g as v,h as w,i as E}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as k}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as A,S as V}from"../chunk-KLIOXJR3.js";import{a as R}from"../chunk-QTWEINJ4.js";import{f as S}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var l="express",i=p=>new a({frameworkName:l,...p,handler:(t,o)=>({body:()=>t.body,headers:e=>{let r=t.headers[e];return Array.isArray(r)?r[0]:r},method:()=>t.method||"GET",url:()=>{let e=t.headers.host||"",r=e!=null&&e.includes("://")?"":`${t.protocol||"https"}://`;return new URL(t.originalUrl||t.url||"",`${r}${e||""}`)},queryString:e=>{let r=t.query[e];return Array.isArray(r)?r[0]:r},transformResponse:({body:e,headers:r,status:s})=>(Object.entries(r).forEach(([n,d])=>{o.setHeader(n,d)}),o.status(s).send(e))})}).createHandler();export{y as Actions,A as AgentDeliveryError,h as Button,c as Card,m as CardLink,f as CardText,x as Client,S as CronExpression,H as Divider,a as NovuRequestHandler,v as Select,w as SelectOption,V as SeverityLevelEnum,E as TextInput,N as agent,l as frameworkName,R as providerSchemas,i as serve,k as step,b as workflow};
1
+ import{b as x,c as a,d as V,e as O}from"../chunk-Q6BV36LU.js";import{a as y,b as h,c,d as m,e as f,f as H,g as v,h as w,i as E}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as $}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as A,N,O as R,V as k}from"../chunk-E2MET7IR.js";import{a as b}from"../chunk-CANJPWLT.js";import{f as S}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var l="express",U=p=>new a({frameworkName:l,...p,handler:(t,o)=>({body:()=>t.body,headers:e=>{let r=t.headers[e];return Array.isArray(r)?r[0]:r},method:()=>t.method||"GET",url:()=>{let e=t.headers.host||"",r=e!=null&&e.includes("://")?"":`${t.protocol||"https"}://`;return new URL(t.originalUrl||t.url||"",`${r}${e||""}`)},queryString:e=>{let r=t.query[e];return Array.isArray(r)?r[0]:r},transformResponse:({body:e,headers:r,status:s})=>(Object.entries(r).forEach(([n,d])=>{o.setHeader(n,d)}),o.status(s).send(e))})}).createHandler();export{y as Actions,N as AgentDeliveryError,A as AgentError,h as Button,c as Card,m as CardLink,f as CardText,x as Client,S as CronExpression,H as Divider,a as NovuRequestHandler,v as Select,w as SelectOption,k as SeverityLevelEnum,E as TextInput,V as agent,l as frameworkName,b as providerSchemas,U as serve,$ as step,R as toAgentError,O as workflow};
@@ -1,12 +1,12 @@
1
1
  import * as h3 from 'h3';
2
2
  import { H3Event } from 'h3';
3
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
4
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
5
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
3
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
4
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
5
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
7
7
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
8
8
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
9
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
9
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
10
10
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
11
11
  import '../util.types-DaFfsxgy.js';
12
12
  import '../base.schema.types-BApIn9jr.js';
@@ -1 +1 @@
1
- import{b as E,c as t,d as x,e as q}from"../chunk-YF62BBGH.js";import{a as l,b as y,c as H,d as S,e as i,f,g,h as N,i as w}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as F}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as k,S as b}from"../chunk-KLIOXJR3.js";import{a as O}from"../chunk-QTWEINJ4.js";import{f as c}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";import{getHeader as o,getQuery as a,readBody as p,send as n,setHeaders as m}from"h3";var h="h3",C=d=>new t({frameworkName:h,...d,handler:r=>({body:()=>p(r),headers:e=>o(r,e),method:()=>r.method,url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),queryString:e=>String(a(r)[e]),transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),n(r,e.body)}})}).createHandler();export{l as Actions,k as AgentDeliveryError,y as Button,H as Card,S as CardLink,i as CardText,E as Client,c as CronExpression,f as Divider,t as NovuRequestHandler,g as Select,N as SelectOption,b as SeverityLevelEnum,w as TextInput,x as agent,h as frameworkName,O as providerSchemas,C as serve,F as step,q as workflow};
1
+ import{b as E,c as t,d as b,e as $}from"../chunk-Q6BV36LU.js";import{a as l,b as y,c as H,d as S,e as i,f,g,h as N,i as w}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as B}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as k,N as x,O,V as F}from"../chunk-E2MET7IR.js";import{a as q}from"../chunk-CANJPWLT.js";import{f as c}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";import{getHeader as o,getQuery as a,readBody as p,send as n,setHeaders as m}from"h3";var h="h3",L=d=>new t({frameworkName:h,...d,handler:r=>({body:()=>p(r),headers:e=>o(r,e),method:()=>r.method,url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),queryString:e=>String(a(r)[e]),transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),n(r,e.body)}})}).createHandler();export{l as Actions,x as AgentDeliveryError,k as AgentError,y as Button,H as Card,S as CardLink,i as CardText,E as Client,c as CronExpression,f as Divider,t as NovuRequestHandler,g as Select,N as SelectOption,F as SeverityLevelEnum,w as TextInput,b as agent,h as frameworkName,q as providerSchemas,L as serve,B as step,O as toAgentError,$ as workflow};
@@ -1,13 +1,13 @@
1
1
  import * as aws_lambda from 'aws-lambda';
2
2
  import { APIGatewayProxyEventV2, APIGatewayProxyResult } from 'aws-lambda';
3
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
4
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
5
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
3
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
4
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
5
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
7
7
  import { E as Either } from '../util.types-DaFfsxgy.js';
8
8
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
9
9
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
10
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
10
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
11
11
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
12
12
  import '../base.schema.types-BApIn9jr.js';
13
13
  import 'json-schema-to-ts';
@@ -1 +1 @@
1
- import{b as E,c as n,d as A,e as b}from"../chunk-YF62BBGH.js";import{a as m,b as u,c as P,d as h,e as i,f as w,g as l,h as f,i as x}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as q}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as I,S}from"../chunk-KLIOXJR3.js";import{a as G}from"../chunk-QTWEINJ4.js";import{f as c}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var p="lambda",V=y=>new n({frameworkName:p,...y,handler:r=>{let s=(e=>e.version==="2.0")(r);return{url:()=>{let e=s?r.requestContext.http.path:r.path,t=r.headers["x-forwarded-proto"]||"https",a=new URL(e,`${t}://${r.headers.host||r.headers.Host||""}`);for(let o in r.queryStringParameters)o&&a.searchParams.set(o,r.queryStringParameters[o]);return a},body:()=>{let e="{}";return r.body&&(e=r.isBase64Encoded?Buffer.from(r.body,"base64").toString():r.body),JSON.parse(e)},headers:e=>r.headers[e],queryString:e=>{var t;return(t=r.queryStringParameters)==null?void 0:t[e]},transformResponse:({body:e,status:t,headers:a})=>Promise.resolve({body:e,statusCode:t,headers:a}),method:()=>s?r.requestContext.http.method:r.httpMethod}}}).createHandler();export{m as Actions,I as AgentDeliveryError,u as Button,P as Card,h as CardLink,i as CardText,E as Client,c as CronExpression,w as Divider,n as NovuRequestHandler,l as Select,f as SelectOption,S as SeverityLevelEnum,x as TextInput,A as agent,p as frameworkName,G as providerSchemas,V as serve,q as step,b as workflow};
1
+ import{b as E,c as n,d as S,e as g}from"../chunk-Q6BV36LU.js";import{a as m,b as u,c as P,d as h,e as i,f as w,g as l,h as f,i as x}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as V}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as I,N as A,O as G,V as q}from"../chunk-E2MET7IR.js";import{a as b}from"../chunk-CANJPWLT.js";import{f as c}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var p="lambda",N=y=>new n({frameworkName:p,...y,handler:r=>{let s=(e=>e.version==="2.0")(r);return{url:()=>{let e=s?r.requestContext.http.path:r.path,t=r.headers["x-forwarded-proto"]||"https",a=new URL(e,`${t}://${r.headers.host||r.headers.Host||""}`);for(let o in r.queryStringParameters)o&&a.searchParams.set(o,r.queryStringParameters[o]);return a},body:()=>{let e="{}";return r.body&&(e=r.isBase64Encoded?Buffer.from(r.body,"base64").toString():r.body),JSON.parse(e)},headers:e=>r.headers[e],queryString:e=>{var t;return(t=r.queryStringParameters)==null?void 0:t[e]},transformResponse:({body:e,status:t,headers:a})=>Promise.resolve({body:e,statusCode:t,headers:a}),method:()=>s?r.requestContext.http.method:r.httpMethod}}}).createHandler();export{m as Actions,A as AgentDeliveryError,I as AgentError,u as Button,P as Card,h as CardLink,i as CardText,E as Client,c as CronExpression,w as Divider,n as NovuRequestHandler,l as Select,f as SelectOption,q as SeverityLevelEnum,x as TextInput,S as agent,p as frameworkName,b as providerSchemas,N as serve,V as step,G as toAgentError,g as workflow};
@@ -1,12 +1,12 @@
1
- import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-DEehllqa.js';
2
- export { A as AgentDeliveryError, a as agent, w as workflow } from '../index-DEehllqa.js';
3
- import { W as Workflow } from '../health-check.types-nDCnGlmX.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-nDCnGlmX.js';
1
+ import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-aVljLqR4.js';
2
+ export { a as agent, w as workflow } from '../index-aVljLqR4.js';
3
+ import { W as Workflow } from '../health-check.types-BNocZ4Wk.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-BNocZ4Wk.js';
5
5
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
6
- import { A as Agent } from '../agent.types-Bu3DhlVb.js';
7
- export { a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
6
+ import { A as Agent } from '../agent.types-E3sxq6xr.js';
7
+ export { a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
8
8
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
9
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
9
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
10
10
  import { Request, Response } from 'express';
11
11
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
12
12
  import { VercelRequest, VercelResponse } from '@vercel/node';
@@ -1 +1 @@
1
- import{b as J,c as P,d as W,e as ee}from"../chunk-YF62BBGH.js";import{a as j,b as F,c as L,d as V,e as U,f as k,g as B,h as $,i as K}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as re}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as Q,S as Z}from"../chunk-KLIOXJR3.js";import{a as X}from"../chunk-QTWEINJ4.js";import{f as z}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import{d as n,e as i}from"../chunk-FHYMHX3T.js";import{Inject as N,Injectable as H}from"@nestjs/common";import{ConfigurableModuleBuilder as x}from"@nestjs/common";var{ConfigurableModuleClass:u,MODULE_OPTIONS_TOKEN:m,OPTIONS_TYPE:oe,ASYNC_OPTIONS_TYPE:se}=new x().setClassMethodName("register").setFactoryMethodName("createNovuModuleOptions").setExtras(o=>({...o,isGlobal:!0})).build();var h="REGISTER_API_PATH",E="REGISTER_CONTROLLER_DECORATORS";import{Injectable as A}from"@nestjs/common";var c=class{handler(e,r){return{body:()=>e.body,headers:t=>{let a=e.headers[t.toLowerCase()];return Array.isArray(a)?a[0]:a},method:()=>e.method||"GET",queryString:t=>{let a=e.query[t];return Array.isArray(a)?a[0]:a},url:()=>{let t=e.headers.host||"",a=t!=null&&t.includes("://")?"":`${e.protocol||"https"}://`;return new URL(e.originalUrl||e.url||"",`${a}${t||""}`)},transformResponse:({body:t,headers:a,status:y})=>(Object.entries(a).forEach(([I,_])=>{r.setHeader(I,_)}),r.status(y).send(t))}}};c=n([A()],c);var q="nest",l=class{constructor(e,r){this.options=e;this.novuHandler=r;this.novuRequestHandler=new P({frameworkName:q,...this.options,handler:this.novuHandler.handler})}async handleRequest(e,r){await this.novuRequestHandler.createHandler()(e,r)}};l=n([H(),i(0,N(m)),i(1,N(c))],l);import{Controller as M,Get as D,Inject as C,Options as b,Post as w,Req as f,Res as O}from"@nestjs/common";var p=class{constructor(e){this.novuService=e}async handleGet(e,r){await this.novuService.handleRequest(e,r)}async handlePost(e,r){await this.novuService.handleRequest(e,r)}async handleOptions(e,r){await this.novuService.handleRequest(e,r)}};n([D(),i(0,f()),i(1,O())],p.prototype,"handleGet",1),n([w(),i(0,f()),i(1,O())],p.prototype,"handlePost",1),n([b(),i(0,f()),i(1,O())],p.prototype,"handleOptions",1),p=n([M(),i(0,C(l))],p);import{Module as G}from"@nestjs/common";import{PATH_METADATA as Y}from"@nestjs/common/constants";var R={provide:h,useFactory:o=>{if(!o.apiPath)throw new Error("`apiPath` must be provided to set the controller path");Reflect.defineMetadata(Y,o.apiPath,p)},inject:[m]};function T(o,e=[]){return e.reduce((r,s)=>{let t=s(r);return t!=null?t:r},o)}function g(o,e){var r;for(let s of(r=Reflect.getMetadataKeys(o))!=null?r:[])Reflect.defineMetadata(s,Reflect.getMetadata(s,o),e)}function S(o,e=[]){let r=T(o,e);r!==o&&g(r,o)}var v={provide:E,useFactory:o=>{var e;S(p,(e=o.controllerDecorators)!=null?e:[])},inject:[m]};var d=class extends u{static register(e,r){var t;let s=u.register(e);return s.controllers=[T(p,e.controllerDecorators||[])],(t=s.providers)==null||t.push(R,l,c,...r||[]),s.exports=[l,c],s}static registerAsync(e,r){var t;let s=u.registerAsync(e);return s.controllers=[p],(t=s.providers)==null||t.push(R,v,l,c,...r||[]),s.exports=[l,c],s}};d=n([G({})],d);export{j as Actions,Q as AgentDeliveryError,F as Button,L as Card,V as CardLink,U as CardText,J as Client,z as CronExpression,k as Divider,m as NOVU_OPTIONS,l as NovuClient,p as NovuController,c as NovuHandler,d as NovuModule,P as NovuRequestHandler,h as REGISTER_API_PATH,E as REGISTER_CONTROLLER_DECORATORS,B as Select,$ as SelectOption,Z as SeverityLevelEnum,K as TextInput,W as agent,q as frameworkName,X as providerSchemas,R as registerApiPath,v as registerControllerDecorators,re as step,ee as workflow};
1
+ import{b as J,c as P,d as Z,e as te}from"../chunk-Q6BV36LU.js";import{a as j,b as F,c as L,d as V,e as U,f as k,g as B,h as $,i as K}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as oe}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as Q,N as W,O as X,V as re}from"../chunk-E2MET7IR.js";import{a as ee}from"../chunk-CANJPWLT.js";import{f as z}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import{d as n,e as i}from"../chunk-FHYMHX3T.js";import{Inject as N,Injectable as H}from"@nestjs/common";import{ConfigurableModuleBuilder as x}from"@nestjs/common";var{ConfigurableModuleClass:u,MODULE_OPTIONS_TOKEN:m,OPTIONS_TYPE:pe,ASYNC_OPTIONS_TYPE:ae}=new x().setClassMethodName("register").setFactoryMethodName("createNovuModuleOptions").setExtras(o=>({...o,isGlobal:!0})).build();var h="REGISTER_API_PATH",E="REGISTER_CONTROLLER_DECORATORS";import{Injectable as A}from"@nestjs/common";var c=class{handler(e,r){return{body:()=>e.body,headers:t=>{let a=e.headers[t.toLowerCase()];return Array.isArray(a)?a[0]:a},method:()=>e.method||"GET",queryString:t=>{let a=e.query[t];return Array.isArray(a)?a[0]:a},url:()=>{let t=e.headers.host||"",a=t!=null&&t.includes("://")?"":`${e.protocol||"https"}://`;return new URL(e.originalUrl||e.url||"",`${a}${t||""}`)},transformResponse:({body:t,headers:a,status:y})=>(Object.entries(a).forEach(([I,_])=>{r.setHeader(I,_)}),r.status(y).send(t))}}};c=n([A()],c);var q="nest",l=class{constructor(e,r){this.options=e;this.novuHandler=r;this.novuRequestHandler=new P({frameworkName:q,...this.options,handler:this.novuHandler.handler})}async handleRequest(e,r){await this.novuRequestHandler.createHandler()(e,r)}};l=n([H(),i(0,N(m)),i(1,N(c))],l);import{Controller as M,Get as D,Inject as C,Options as b,Post as w,Req as f,Res as O}from"@nestjs/common";var p=class{constructor(e){this.novuService=e}async handleGet(e,r){await this.novuService.handleRequest(e,r)}async handlePost(e,r){await this.novuService.handleRequest(e,r)}async handleOptions(e,r){await this.novuService.handleRequest(e,r)}};n([D(),i(0,f()),i(1,O())],p.prototype,"handleGet",1),n([w(),i(0,f()),i(1,O())],p.prototype,"handlePost",1),n([b(),i(0,f()),i(1,O())],p.prototype,"handleOptions",1),p=n([M(),i(0,C(l))],p);import{Module as G}from"@nestjs/common";import{PATH_METADATA as Y}from"@nestjs/common/constants";var R={provide:h,useFactory:o=>{if(!o.apiPath)throw new Error("`apiPath` must be provided to set the controller path");Reflect.defineMetadata(Y,o.apiPath,p)},inject:[m]};function T(o,e=[]){return e.reduce((r,s)=>{let t=s(r);return t!=null?t:r},o)}function g(o,e){var r;for(let s of(r=Reflect.getMetadataKeys(o))!=null?r:[])Reflect.defineMetadata(s,Reflect.getMetadata(s,o),e)}function S(o,e=[]){let r=T(o,e);r!==o&&g(r,o)}var v={provide:E,useFactory:o=>{var e;S(p,(e=o.controllerDecorators)!=null?e:[])},inject:[m]};var d=class extends u{static register(e,r){var t;let s=u.register(e);return s.controllers=[T(p,e.controllerDecorators||[])],(t=s.providers)==null||t.push(R,l,c,...r||[]),s.exports=[l,c],s}static registerAsync(e,r){var t;let s=u.registerAsync(e);return s.controllers=[p],(t=s.providers)==null||t.push(R,v,l,c,...r||[]),s.exports=[l,c],s}};d=n([G({})],d);export{j as Actions,W as AgentDeliveryError,Q as AgentError,F as Button,L as Card,V as CardLink,U as CardText,J as Client,z as CronExpression,k as Divider,m as NOVU_OPTIONS,l as NovuClient,p as NovuController,c as NovuHandler,d as NovuModule,P as NovuRequestHandler,h as REGISTER_API_PATH,E as REGISTER_CONTROLLER_DECORATORS,B as Select,$ as SelectOption,re as SeverityLevelEnum,K as TextInput,Z as agent,q as frameworkName,ee as providerSchemas,R as registerApiPath,v as registerControllerDecorators,oe as step,X as toAgentError,te as workflow};
@@ -1,11 +1,11 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
3
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
5
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
2
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
3
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
5
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
6
6
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
7
7
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
8
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
8
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
9
9
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
10
10
  import '../util.types-DaFfsxgy.js';
11
11
  import '../base.schema.types-BApIn9jr.js';
@@ -1 +1 @@
1
- import{a as l,b as v,c,d as F,e as G}from"../chunk-YF62BBGH.js";import{a as O,b as x,c as q,d as S,e as T,f as w,g as P,h as A,i as E}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as I}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as g,S as k}from"../chunk-KLIOXJR3.js";import{a as j}from"../chunk-QTWEINJ4.js";import{f as b}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="next",N=o=>typeof o=="object"&&o!==null&&typeof o.setHeader=="function"&&typeof o.status=="function"&&typeof o.send=="function",$=o=>{let p=new c({frameworkName:m,...o,handler:(h,R,d)=>{let n=R,i=e=>{let t=typeof n.headers.get=="function"?n.headers.get(e):n.headers[e];return Array.isArray(t)?t[0]:t};return{body:()=>typeof n.json=="function"?n.json():n.body,headers:i,method:()=>h||n.method||"",queryString:(e,t)=>{var a;let r=((a=n.query)==null?void 0:a[e])||t.searchParams.get(e);return Array.isArray(r)?r[0]:r},url:()=>{let e;try{e=new URL(n.url)}catch{}if(e){let s=i("host");if(s){let u=new URL(s.includes("://")?s:`${e.protocol}//${s}`);e.protocol=u.protocol,e.host=u.host,e.port=u.port,e.username=u.username,e.password=u.password}return e}let t="https",r=i("host")||"";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(t="http")}catch{}return new URL(n.url,`${t}://${r}`)},transformResponse:({body:e,headers:t,status:r})=>{if(N(d)){Object.entries(t).forEach(([s,u])=>{d.setHeader(s,u)}),d.status(r).send(e);return}let a=l();return new a(e,{status:r,headers:t})}}}}).createHandler(),f=p.bind(null,void 0);return Object.defineProperties(f,{GET:{value:p.bind(null,"GET")},POST:{value:p.bind(null,"POST")},OPTIONS:{value:p.bind(null,"OPTIONS")}})};export{O as Actions,g as AgentDeliveryError,x as Button,q as Card,S as CardLink,T as CardText,v as Client,b as CronExpression,w as Divider,c as NovuRequestHandler,P as Select,A as SelectOption,k as SeverityLevelEnum,E as TextInput,F as agent,m as frameworkName,j as providerSchemas,$ as serve,I as step,G as workflow};
1
+ import{a as l,b as v,c,d as k,e as U}from"../chunk-Q6BV36LU.js";import{a as O,b as x,c as q,d as S,e as T,f as w,g as P,h as A,i as E}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as L}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as g,N as F,O as j,V as I}from"../chunk-E2MET7IR.js";import{a as G}from"../chunk-CANJPWLT.js";import{f as b}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="next",N=o=>typeof o=="object"&&o!==null&&typeof o.setHeader=="function"&&typeof o.status=="function"&&typeof o.send=="function",V=o=>{let p=new c({frameworkName:m,...o,handler:(h,R,d)=>{let n=R,i=e=>{let t=typeof n.headers.get=="function"?n.headers.get(e):n.headers[e];return Array.isArray(t)?t[0]:t};return{body:()=>typeof n.json=="function"?n.json():n.body,headers:i,method:()=>h||n.method||"",queryString:(e,t)=>{var a;let r=((a=n.query)==null?void 0:a[e])||t.searchParams.get(e);return Array.isArray(r)?r[0]:r},url:()=>{let e;try{e=new URL(n.url)}catch{}if(e){let s=i("host");if(s){let u=new URL(s.includes("://")?s:`${e.protocol}//${s}`);e.protocol=u.protocol,e.host=u.host,e.port=u.port,e.username=u.username,e.password=u.password}return e}let t="https",r=i("host")||"";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(t="http")}catch{}return new URL(n.url,`${t}://${r}`)},transformResponse:({body:e,headers:t,status:r})=>{if(N(d)){Object.entries(t).forEach(([s,u])=>{d.setHeader(s,u)}),d.status(r).send(e);return}let a=l();return new a(e,{status:r,headers:t})}}}}).createHandler(),f=p.bind(null,void 0);return Object.defineProperties(f,{GET:{value:p.bind(null,"GET")},POST:{value:p.bind(null,"POST")},OPTIONS:{value:p.bind(null,"OPTIONS")}})};export{O as Actions,F as AgentDeliveryError,g as AgentError,x as Button,q as Card,S as CardLink,T as CardText,v as Client,b as CronExpression,w as Divider,c as NovuRequestHandler,P as Select,A as SelectOption,I as SeverityLevelEnum,E as TextInput,k as agent,m as frameworkName,G as providerSchemas,V as serve,L as step,j as toAgentError,U as workflow};
@@ -1,12 +1,12 @@
1
1
  import * as h3 from 'h3';
2
2
  import { H3Event } from 'h3';
3
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
4
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
5
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
3
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
4
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
5
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
7
7
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
8
8
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
9
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
9
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
10
10
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
11
11
  import '../util.types-DaFfsxgy.js';
12
12
  import '../base.schema.types-BApIn9jr.js';
@@ -1 +1 @@
1
- import{b as x,c as t,d as k,e as q}from"../chunk-YF62BBGH.js";import{a as l,b as H,c as S,d as i,e as y,f,g,h as N,i as w}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as F}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as E,S as b}from"../chunk-KLIOXJR3.js";import{a as O}from"../chunk-QTWEINJ4.js";import{f as c}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";import{getHeader as o,getQuery as a,readBody as n,send as p,setHeaders as m}from"h3";var u="nuxt",D=d=>new t({frameworkName:u,...d,handler:r=>({queryString:e=>String(a(r)[e]),body:()=>n(r),headers:e=>o(r,e),url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),method:()=>r.method,transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),p(r,e.body)}})}).createHandler();export{l as Actions,E as AgentDeliveryError,H as Button,S as Card,i as CardLink,y as CardText,x as Client,c as CronExpression,f as Divider,t as NovuRequestHandler,g as Select,N as SelectOption,b as SeverityLevelEnum,w as TextInput,k as agent,u as frameworkName,O as providerSchemas,D as serve,F as step,q as workflow};
1
+ import{b as x,c as t,d as b,e as $}from"../chunk-Q6BV36LU.js";import{a as l,b as H,c as S,d as i,e as y,f,g,h as N,i as w}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as B}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as E,N as k,O,V as F}from"../chunk-E2MET7IR.js";import{a as q}from"../chunk-CANJPWLT.js";import{f as c}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";import{getHeader as o,getQuery as a,readBody as n,send as p,setHeaders as m}from"h3";var u="nuxt",Q=d=>new t({frameworkName:u,...d,handler:r=>({queryString:e=>String(a(r)[e]),body:()=>n(r),headers:e=>o(r,e),url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),method:()=>r.method,transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),p(r,e.body)}})}).createHandler();export{l as Actions,k as AgentDeliveryError,E as AgentError,H as Button,S as Card,i as CardLink,y as CardText,x as Client,c as CronExpression,f as Divider,t as NovuRequestHandler,g as Select,N as SelectOption,F as SeverityLevelEnum,w as TextInput,b as agent,u as frameworkName,q as providerSchemas,Q as serve,B as step,O as toAgentError,$ as workflow};
@@ -1,10 +1,10 @@
1
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
2
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
3
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
4
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
1
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
2
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
3
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
4
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
5
5
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
6
6
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
7
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
7
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
8
8
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
9
9
  import '../util.types-DaFfsxgy.js';
10
10
  import '../base.schema.types-BApIn9jr.js';
@@ -1 +1 @@
1
- import{a as t,b as v,c as o,d as N,e as y}from"../chunk-YF62BBGH.js";import{a as u,b as h,c as l,d as R,e as c,f as i,g as w,h as f,i as x}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as q}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as H,S as g}from"../chunk-KLIOXJR3.js";import{a as S}from"../chunk-QTWEINJ4.js";import{f as k}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="remix",b=s=>new o({frameworkName:m,...s,handler:({request:e})=>({body:()=>e.json(),headers:r=>e.headers.get(r),method:()=>e.method,url:()=>new URL(e.url,`https://${e.headers.get("host")||""}`),transformResponse:({body:r,status:n,headers:p})=>{let a=t();return new a(r,{status:n,headers:p})}})}).createHandler();export{u as Actions,H as AgentDeliveryError,h as Button,l as Card,R as CardLink,c as CardText,v as Client,k as CronExpression,i as Divider,o as NovuRequestHandler,w as Select,f as SelectOption,g as SeverityLevelEnum,x as TextInput,N as agent,m as frameworkName,S as providerSchemas,b as serve,q as step,y as workflow};
1
+ import{a as t,b as v,c as o,d as g,e as F}from"../chunk-Q6BV36LU.js";import{a as u,b as h,c as l,d as R,e as c,f as i,g as w,h as f,i as x}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as O}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as H,N,O as S,V as q}from"../chunk-E2MET7IR.js";import{a as y}from"../chunk-CANJPWLT.js";import{f as k}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="remix",L=s=>new o({frameworkName:m,...s,handler:({request:e})=>({body:()=>e.json(),headers:r=>e.headers.get(r),method:()=>e.method,url:()=>new URL(e.url,`https://${e.headers.get("host")||""}`),transformResponse:({body:r,status:n,headers:p})=>{let a=t();return new a(r,{status:n,headers:p})}})}).createHandler();export{u as Actions,N as AgentDeliveryError,H as AgentError,h as Button,l as Card,R as CardLink,c as CardText,v as Client,k as CronExpression,i as Divider,o as NovuRequestHandler,w as Select,f as SelectOption,q as SeverityLevelEnum,x as TextInput,g as agent,m as frameworkName,y as providerSchemas,L as serve,O as step,S as toAgentError,F as workflow};
@@ -1,11 +1,11 @@
1
1
  import { RequestEvent } from '@sveltejs/kit';
2
- import { S as ServeHandlerOptions } from '../index-DEehllqa.js';
3
- export { A as AgentDeliveryError, C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-DEehllqa.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-nDCnGlmX.js';
5
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-BbyO_Cz6.js';
2
+ import { S as ServeHandlerOptions } from '../index-aVljLqR4.js';
3
+ export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-aVljLqR4.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-BNocZ4Wk.js';
5
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-CmybpXhA.js';
6
6
  import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js';
7
7
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
8
- export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentHandlerContext, g as AgentHandlers, h as AgentHistoryEntry, i as AgentMessage, j as AgentMessageAuthor, k as AgentMessageContext, l as AgentPlatformContext, m as AgentReaction, n as AgentReactionContext, o as AgentResolveContext, p as AgentSubscriber, q as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, r as ToolApprovalConfig, s as ToolApprovalDecision } from '../agent.types-Bu3DhlVb.js';
8
+ export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentConversation, f as AgentDeliveryError, g as AgentError, h as AgentHandlerContext, i as AgentHandlers, j as AgentHistoryEntry, k as AgentMessage, l as AgentMessageAuthor, m as AgentMessageContext, n as AgentPlatformContext, o as AgentReaction, p as AgentReactionContext, q as AgentResolveContext, r as AgentSubscriber, s as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, t as ToolApprovalConfig, u as ToolApprovalDecision, v as toAgentError } from '../agent.types-E3sxq6xr.js';
9
9
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
10
10
  import '../util.types-DaFfsxgy.js';
11
11
  import '../base.schema.types-BApIn9jr.js';
@@ -1 +1 @@
1
- import{a as r,b as q,c as s,d as b,e as G}from"../chunk-YF62BBGH.js";import{a as v,b as E,c as P,d as R,e as T,f as S,g as c,h as f,i as h}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as I}from"../chunk-2M25EATE.js";import"../chunk-DKQLYSZS.js";import{M as F,S as y}from"../chunk-KLIOXJR3.js";import{a as w}from"../chunk-QTWEINJ4.js";import{f as N}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="sveltekit",g=o=>{let t=new s({frameworkName:m,...o,handler:(u,e)=>({method:()=>u||e.request.method||"",body:()=>e.request.json(),headers:n=>e.request.headers.get(n),url:()=>{let n=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"?"http":"https";return new URL(e.request.url,`${n}://${e.request.headers.get("host")||""}`)},transformResponse:({body:n,headers:d,status:a})=>{let l=r();return new l(n,{status:a,headers:d})}})}).createHandler(),p=t.bind(null,void 0);return Object.defineProperties(p,{GET:{value:t.bind(null,"GET")},POST:{value:t.bind(null,"POST")},OPTIONS:{value:t.bind(null,"OPTIONS")}})};export{v as Actions,F as AgentDeliveryError,E as Button,P as Card,R as CardLink,T as CardText,q as Client,N as CronExpression,S as Divider,s as NovuRequestHandler,c as Select,f as SelectOption,y as SeverityLevelEnum,h as TextInput,b as agent,m as frameworkName,w as providerSchemas,g as serve,I as step,G as workflow};
1
+ import{a as r,b as q,c as s,d as y,e as k}from"../chunk-Q6BV36LU.js";import{a as v,b as E,c as P,d as R,e as T,f as S,g as c,h as f,i as h}from"../chunk-C3P3ZH2I.js";import"../chunk-3XT6S7TZ.js";import{a as H}from"../chunk-2M25EATE.js";import"../chunk-22DBAEUX.js";import{M as F,N as b,O as w,V as I}from"../chunk-E2MET7IR.js";import{a as G}from"../chunk-CANJPWLT.js";import{f as N}from"../chunk-FRWG7YTE.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="sveltekit",j=o=>{let t=new s({frameworkName:m,...o,handler:(u,e)=>({method:()=>u||e.request.method||"",body:()=>e.request.json(),headers:n=>e.request.headers.get(n),url:()=>{let n=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"?"http":"https";return new URL(e.request.url,`${n}://${e.request.headers.get("host")||""}`)},transformResponse:({body:n,headers:d,status:a})=>{let l=r();return new l(n,{status:a,headers:d})}})}).createHandler(),p=t.bind(null,void 0);return Object.defineProperties(p,{GET:{value:t.bind(null,"GET")},POST:{value:t.bind(null,"POST")},OPTIONS:{value:t.bind(null,"OPTIONS")}})};export{v as Actions,b as AgentDeliveryError,F as AgentError,E as Button,P as Card,R as CardLink,T as CardText,q as Client,N as CronExpression,S as Divider,s as NovuRequestHandler,c as Select,f as SelectOption,I as SeverityLevelEnum,h as TextInput,y as agent,m as frameworkName,G as providerSchemas,j as serve,H as step,w as toAgentError,k as workflow};
@@ -1,5 +1,5 @@
1
- import { S as Subscriber, C as ContextResolved, E as EnvironmentSystemVariables, G as EmailOutputUnvalidated, p as providerSchemas, W as WithPassthrough, R as SmsOutputUnvalidated, h as ChatOutputUnvalidated, M as PushOutputUnvalidated, J as InAppOutputUnvalidated, n as DelayOutputUnvalidated, v as DigestOutputUnvalidated, Y as ThrottleOutputUnvalidated } from './subscriber.types-BbyO_Cz6.js';
2
- export { _ as actionStepSchemas, $ as channelStepSchemas } from './subscriber.types-BbyO_Cz6.js';
1
+ import { S as Subscriber, C as ContextResolved, E as EnvironmentSystemVariables, G as EmailOutputUnvalidated, p as providerSchemas, W as WithPassthrough, R as SmsOutputUnvalidated, h as ChatOutputUnvalidated, M as PushOutputUnvalidated, J as InAppOutputUnvalidated, n as DelayOutputUnvalidated, v as DigestOutputUnvalidated, Y as ThrottleOutputUnvalidated } from './subscriber.types-CmybpXhA.js';
2
+ export { _ as actionStepSchemas, $ as channelStepSchemas } from './subscriber.types-CmybpXhA.js';
3
3
  import { A as Awaitable } from './util.types-DaFfsxgy.js';
4
4
  import { S as Schema, a as FromSchema } from './base.schema.types-BApIn9jr.js';
5
5
  import 'json-schema-to-ts';
@@ -1 +1 @@
1
- import{a as o}from"./chunk-2M25EATE.js";import{a as e,e as t,f as r}from"./chunk-QTWEINJ4.js";import"./chunk-FHYMHX3T.js";export{t as actionStepSchemas,r as channelStepSchemas,e as providerSchemas,o as step};
1
+ import{a as o}from"./chunk-2M25EATE.js";import{a as e,e as t,f as r}from"./chunk-CANJPWLT.js";import"./chunk-FHYMHX3T.js";export{t as actionStepSchemas,r as channelStepSchemas,e as providerSchemas,o as step};
@@ -179,6 +179,14 @@ declare const providerSchemas: {
179
179
  readonly additionalProperties: true;
180
180
  };
181
181
  };
182
+ readonly sendblue: {
183
+ output: {
184
+ readonly type: "object";
185
+ readonly properties: {};
186
+ readonly required: readonly [];
187
+ readonly additionalProperties: true;
188
+ };
189
+ };
182
190
  readonly slack: {
183
191
  output: {
184
192
  readonly type: "object";
@@ -648,6 +656,14 @@ declare const providerSchemas: {
648
656
  };
649
657
  };
650
658
  readonly email: {
659
+ readonly anypost: {
660
+ output: {
661
+ readonly type: "object";
662
+ readonly properties: {};
663
+ readonly required: readonly [];
664
+ readonly additionalProperties: true;
665
+ };
666
+ };
651
667
  readonly braze: {
652
668
  output: {
653
669
  readonly type: "object";
@@ -1 +1 @@
1
- import{a,b}from"./chunk-DKQLYSZS.js";import"./chunk-FRWG7YTE.js";import"./chunk-FHYMHX3T.js";export{b as transformSchema,a as validateData};
1
+ import{a,b}from"./chunk-22DBAEUX.js";import"./chunk-FRWG7YTE.js";import"./chunk-FHYMHX3T.js";export{b as transformSchema,a as validateData};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novu/framework",
3
- "version": "2.11.2-alpha.0",
3
+ "version": "2.11.2-alpha.1",
4
4
  "description": "The Code-First Notifications Workflow SDK.",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "types": "./dist/cjs/index.d.cts",
@@ -329,7 +329,7 @@
329
329
  "test:watch": "vitest --typecheck --watch",
330
330
  "check": "biome check .",
331
331
  "check:fix": "biome check --write .",
332
- "build": "NODE_ENV=production tsup",
332
+ "build": "cross-env NODE_ENV=production tsup",
333
333
  "debug": "NODE_ENV=production tsup --config tsup-debug.config.ts",
334
334
  "build:watch": "tsup --watch",
335
335
  "postbuild": "pnpm run check:exports && pnpm check:circulars",
@@ -1 +0,0 @@
1
- import{d as k,g,i as N,q as U,r as D,s as c,t as h,u as v,v as F}from"./chunk-FRWG7YTE.js";import{a as M,c as $,f as L}from"./chunk-W6DIBD4Z.js";var H=class extends v{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var j=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${r}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:r}}},W=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=r}},q=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=r}},V=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=o}},G=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=o}},X=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=o}},K=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${r}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=o}},z=class extends c{constructor(n,r,o,s){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` and provider with id: \`${o}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=s}},Y=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=r}};var Q=t=>Object.values(g).includes(t==null?void 0:t.code),st=t=>!Q(t)&&typeof t.statusCode=="number"&&t.statusCode>=400&&t.statusCode<500;var I=t=>Object.values(t).map(e=>`\`${e}\``).join(", "),T=t=>t.replaceAll(/(\w)(\w*)/g,(e,n,r)=>n.toUpperCase()+r.toLowerCase()).replaceAll(/[\s-]+/g,"");var Z=class extends U{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${I(N)}`}},J=class extends c{constructor(n,r){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${I(r)}`);this.code="InvalidActionError"}},ee=class extends c{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var te=class extends Error{constructor(e,n,r){super(),this.data={message:r},this.statusCode=e,this.code=n}};var y=class extends F{constructor(e,n){super(`${T(e)} with id: \`${n}\` already exists. Please use a different id.`)}},m=class extends D{constructor(e,n){super(`${T(e)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},R=class extends v{constructor(n,r,o,s){super(`Failed to ${o} ${T(n)} with id: \`${r}\``,{cause:s});this.statusCode=502}};var ne=class extends m{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},oe=class extends R{constructor(n,r,o){super("provider",n,r,o);this.code="ProviderExecutionFailedError"}};var se=class extends h{constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.");this.code="SignatureMismatchError"}},ae=class extends h{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},ie=class extends h{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},le=class extends h{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},pe=class extends h{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}},de=class extends h{constructor(){super("Signature version is invalid. Please provide a signature version with version `v1` in the `novu-signature` header");this.code="SignatureVersionInvalidError"}};var ce=class extends m{constructor(n){super("step",n);this.code="StepNotFoundError"}},ue=class extends y{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},ge=class extends R{constructor(n,r,o){super("step",n,r,o);this.code="StepExecutionFailedError"}};var me=class extends m{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}},fe=class extends y{constructor(n){super("workflow",n);this.code="WorkflowAlreadyExistsError"}};function De(t,e){let n={...t};for(let r of Object.keys(e)){let o=e[r];o&&typeof o=="object"&&!Array.isArray(o)?n[r]=De(n[r]||{},o):(Array.isArray(o),n[r]=o)}return n}function E(t,e){let n=e.split(".").reduce((r,o)=>{if(r&&typeof r=="object")return r[o]},t);if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"){let r=JSON.stringify(n);return r==="{}"?"":r}return""}function he(t,e=2,n,r=", "){if(!Array.isArray(t)||t.length===0)return"";let o=n?t.map(i=>typeof i!="object"||!i?"":E(i,n)):t;if(o.length===1)return o[0];if(o.length===2)return`${o[0]} and ${o[1]}`;if(o.length===3&&e>=3)return`${o[0]}, ${r}${o[1]} and ${o[2]}`;let s=o.slice(0,e),l=o.length-e;return`${s.join(r)} and ${l} ${l===1?"other":"others"}`}import Fe from"pluralize";function ye(t,e="",n="",r="true"){if(t==null)return"";let o=0;if(Array.isArray(t)?o=t.length:typeof t=="object"?o=Object.keys(t).length:typeof t=="string"?o=+t:typeof t=="number"?o=t:o=Number(t),Number.isNaN(o)&&(o=0),o<=0)return"";let s;return n?s=o===1?e:n:s=Fe(e,o),r==="true"?`${o} ${s}`:s}import{TokenKind as Re}from"liquidjs";import Me from"pluralize";import{z as f}from"zod";var Ae="",xe=2,_e="other",ve=", ",Te=" and ",Ee=", and ",Se={0:"keyPath",1:"limit",2:"overflowSuffix",3:"wordsConnector",4:"twoWordsConnector",5:"lastWordConnector"};function Ce(t,e=Ae,n=xe,r=_e,o=ve,s=Te,l=Ee){if(!Array.isArray(t)||t.length===0)return"";let i=e?t.map(u=>typeof u!="object"||!u?"":E(u,e)):t,p=i.length;if(p===1)return i[0];if(p===2)return`${i[0]}${s}${i[1]}`;if(n>=p){let u=i.slice(0,p-1),P=i[p-1];return`${u.join(o)}${l}${P}`}let a=i.slice(0,n),d=p-n,_=n===1?s:l;return`${a.join(o)}${_}${d} ${Me(r,d)}`}function nn(t={},...e){let{requireKeyPath:n=!1}=t,r=[];if(e.length<1)return r.push({message:"Expected at least 1 argument",begin:0,end:0,value:""}),r;let o=f.object({keyPath:n?f.string().min(1,"must be non-empty"):f.string().optional().default(Ae),limit:f.number().optional().default(xe).refine(i=>i>=0,"must be greater than or equal to 0"),overflowSuffix:f.string().optional().default(_e),wordsConnector:f.string().optional().default(ve),twoWordsConnector:f.string().optional().default(Te),lastWordConnector:f.string().optional().default(Ee)}),s={};e.forEach((i,p)=>{if(!Array.isArray(i)){let a=i.getText();(i.kind===Re.Quoted||i.kind===Re.Number)&&(a=i.content);let d=Se[p];s[d]=a}});let l=o.safeParse(s);if(!l.success)for(let i of l.error.issues){let p="string";"type"in i&&(p=i.type);let a=i.path[0],d=Object.entries(Se).find(([P,Ue])=>Ue===a),_=d?parseInt(d[0],10):null,u=typeof _=="number"?e[_]:null;u&&!Array.isArray(u)&&r.push({message:`"toSentence" expects a ${p}${i.message?` that ${i.message}`:""} for argument "${a}"`,begin:u.begin,end:u.end,value:u.getText()})}return r}import{Liquid as $e}from"liquidjs";function Le(t){return Array.isArray(t)||typeof t=="object"&&t!==null?we(t):typeof t=="string"?t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):t==null?"":String(t)}var we=(t,e=0)=>Array.isArray(t)||typeof t=="object"&&t!==null?JSON.stringify(t,null,e).replace(/"/g,"'").replace(/\n/g,"\\n"):t==null?"":String(t);function dn(t){let e=new $e({outputEscape:Le,...t});return e.registerFilter("json",(n,r)=>we(n,r)),e.registerFilter("digest",he),e.registerFilter("toSentence",Ce),e.registerFilter("pluralize",ye),e}var He={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",408:"Request Timeout",409:"Conflict",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"};function C(t){return typeof t=="string"&&t.trim()?t:!t||typeof t!="object"?null:C(t.message)}function Be(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object")return null;let n=e,r=C(n.message);if(r)return r;let o=C(n.error);if(o)return o;let s=n.errors;return Array.isArray(s)?C(s[0]):null}var w=class extends Error{constructor(e,n){var l;let r=(l=He[e])!=null?l:e,o=Be(n),s=o?`Delivery failed: ${r}: ${o}`:`Delivery failed: ${r}`;super(s),this.name="AgentDeliveryError",this.statusCode=e,this.responseBody=n}};var je=(o=>(o.ON_MESSAGE="onMessage",o.ON_ACTION="onAction",o.ON_RESOLVE="onResolve",o.ON_REACTION="onReaction",o))(je||{}),O=class{constructor(){this.__novuPendingApproval=!0}};var We=5*1024*1024,qe=5*1024*1024,Oe=32768,Ve=/^[A-Za-z0-9+/]*={0,2}$/;function x(t,e){return t.filename?`"${t.filename}"`:`at index ${e}`}function Pe(){return globalThis.Buffer}function Ge(t){var e,n,r;return(r=(n=(e=Pe())==null?void 0:e.isBuffer)==null?void 0:n.call(e,t))!=null?r:!1}function Xe(t){return typeof Blob!="undefined"&&t instanceof Blob}function b(t){let e=Pe();if(e)return e.from(t).toString("base64");if(typeof btoa!="function")throw new Error("Unable to encode file data: base64 encoding is not available in this runtime.");let n="";for(let r=0;r<t.length;r+=Oe){let o=t.subarray(r,r+Oe);n+=String.fromCharCode(...o)}return btoa(n)}function ke(t){let e=t.replace(/\s/g,""),n=e.length%4;if(!e||n===1||!Ve.test(e))return null;let r=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-r}function S(t,e,n){if(t>We)throw new Error(`Invalid file ${x(e,n)}: inline data must be 5 MB or smaller. Use a publicly-accessible URL for larger files.`)}async function Ke(t,e,n){if(typeof t=="string"){let r=ke(t);if(r===null)throw new Error(`Invalid file ${x(e,n)}: data must be a base64-encoded string.`);return S(r,e,n),t}if(Ge(t))return S(t.byteLength,e,n),t.toString("base64");if(t instanceof Uint8Array)return S(t.byteLength,e,n),b(t);if(t instanceof ArrayBuffer)return S(t.byteLength,e,n),b(new Uint8Array(t));if(Xe(t))return S(t.size,e,n),b(new Uint8Array(await t.arrayBuffer()));throw new Error(`Invalid file ${x(e,n)}: data must be a base64 string, Buffer, Uint8Array, ArrayBuffer, or Blob.`)}async function ze(t){if(!(t!=null&&t.length))return;let e=[],n=0;for(let[r,o]of t.entries()){let s=o.data,l=o.url,i=s!=null,p=l!=null;if(i===p)throw new Error(`Invalid file ${x(o,r)}: provide exactly one of data or url.`);if(i){let a=await Ke(s,o,r),d=ke(a);if(n+=d!=null?d:0,n>qe)throw new Error("Invalid files: total inline data must be 5 MB or smaller. Use publicly-accessible URLs for larger files.");e.push({...o,data:a});continue}if(p&&typeof l!="string")throw new Error(`Invalid file ${x(o,r)}: url must be a string.`);e.push(o)}return e}async function Ne(t,e){let n=await ze(e);if(typeof t=="string")return n?{markdown:t,files:n}:{markdown:t};let{isJSX:r,toCardElement:o}=await import("./jsx-runtime-7EPQR56T.js");if(r(t)){let s=o(t);if(s)return n?{card:s,files:n}:{card:s}}if($(t))return n?{card:t,files:n}:{card:t};throw new Error("Invalid message content \u2014 expected string or CardElement")}var A=class{constructor(e,n,r,o,s){this.conversationId=r;this.integrationIdentifier=o;this.poster=s;this.editedByHandler=!1;this.messageId=e,this.platformThreadId=n}async edit(e,n){this.editedByHandler=!0;let r=await this.poster.post({conversationId:this.conversationId,integrationIdentifier:this.integrationIdentifier,edit:{messageId:this.messageId,content:await Ne(e,n==null?void 0:n.files)}});if(!r)throw new Error("Agent edit did not return a message handle");return this.messageId=r.messageId,this.platformThreadId=r.platformThreadId,this}async delete(){await this.poster.post({conversationId:this.conversationId,integrationIdentifier:this.integrationIdentifier,deleteMessages:[{messageId:this.messageId}]})}},be;be=M;var Ie=class{constructor(e,n,r){this[be]=!0;this._signals=[];this._toolResults=[];this._pendingToolApprovalRequest=null;this._pendingReactions=[];this._pendingDeletes=[];this._resolveSignal=null;var i,p;this.event=e.event,this.action=(i=e.action)!=null?i:null,this.message=e.message,this.reaction=e.reaction,this.conversation=e.conversation,this.subscriber=e.subscriber,this.history=e.history,this.platform=e.platform,this.platformContext=e.platformContext,this._replyUrl=e.replyUrl,this._conversationId=e.conversationId,this._integrationIdentifier=e.integrationIdentifier,this._secretKey=n,this._poster={post:a=>this._post(a)},this._toolApprovalConfig=r,this._metadataState={...(p=e.conversation.metadata)!=null?p:{}};let o=this;this.metadata={get(a){return o._metadataState[a]},set(a,d){o._metadataState[a]=d,o._signals.push({type:"metadata",action:"set",key:a,value:d})},delete(a){delete o._metadataState[a],o._signals.push({type:"metadata",action:"delete",key:a})},clear(){o._metadataState={},o._signals.push({type:"metadata",action:"clear"})},get current(){return{...o._metadataState}}};let s=a=>this._post({conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,typing:a}).then(()=>{}),l=(a=>s(a===void 0?{}:{status:a}));l.stop=()=>s("stop"),this.typing=l,this.toolApproval={request:async a=>(await L(this,a,this._toolApprovalConfig),new O)}}asMessageContext(){return this}async reply(e,n){let r=await Ne(e,n==null?void 0:n.files),o={conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,reply:r};this._drainSideEffects(o);let s=await this._post(o);if(!s)throw new Error("Agent reply did not return a message handle");return new A(s.messageId,s.platformThreadId,this._conversationId,this._integrationIdentifier,this._poster)}async replyApprovalCard(e){let n={conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,reply:{toolApprovalCard:e}};this._drainSideEffects(n);let r=await this._post(n);if(!r)throw new Error("Agent approval card reply did not return a message handle");return new A(r.messageId,r.platformThreadId,this._conversationId,this._integrationIdentifier,this._poster)}createReplyHandle(e){return new A(e,"",this._conversationId,this._integrationIdentifier,this._poster)}resolve(e){this._resolveSignal={summary:e}}trigger(e,n){this._signals.push({...n,type:"trigger",workflowId:e})}emitToolApprovalRequest(e){if(this._pendingToolApprovalRequest)throw new Error("Only one tool approval request can be queued before the next reply");this._pendingToolApprovalRequest=e}emitToolResult(e){this._toolResults.push(e)}addReaction(e,n){this._pendingReactions.push({messageId:e,emojiName:n})}deleteMessage(e){this._pendingDeletes.push({messageId:e})}async flush(){if(!this._hasPendingSideEffects())return;let e={conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier};this._drainSideEffects(e),await this._post(e)}_hasPendingSideEffects(){return!!(this._pendingToolApprovalRequest||this._signals.length||this._toolResults.length||this._resolveSignal||this._pendingReactions.length||this._pendingDeletes.length)}_drainSideEffects(e){this._pendingToolApprovalRequest&&(e.toolApprovalRequest=this._pendingToolApprovalRequest,this._pendingToolApprovalRequest=null),this._signals.length&&(e.signals=this._signals,this._signals=[]),this._toolResults.length&&(e.toolResults=this._toolResults,this._toolResults=[]),this._pendingReactions.length&&(e.addReactions=this._pendingReactions,this._pendingReactions=[]),this._pendingDeletes.length&&(e.deleteMessages=this._pendingDeletes,this._pendingDeletes=[]),this._resolveSignal&&(e.resolve=this._resolveSignal,this._resolveSignal=null)}async _post(e){let n=await fetch(this._replyUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${this._secretKey}`},body:JSON.stringify(e)});if(!n.ok){let o=await n.text().catch(()=>"");throw new w(n.status,o)}let r=await n.text().catch(()=>"");if(!r)return null;try{let o=JSON.parse(r),s=o&&typeof o=="object"&&"data"in o?o.data:o;if(s&&typeof s.messageId=="string"&&typeof s.platformThreadId=="string")return{messageId:s.messageId,platformThreadId:s.platformThreadId}}catch{}return null}};var xn={type:"object",properties:{},required:[],additionalProperties:!1};var Ye=(a=>(a.PENDING="pending",a.QUEUED="queued",a.RUNNING="running",a.COMPLETED="completed",a.FAILED="failed",a.DELAYED="delayed",a.CANCELED="canceled",a.MERGED="merged",a.SKIPPED="skipped",a))(Ye||{});var Qe=(o=>(o.NONE="none",o.LOW="low",o.MEDIUM="medium",o.HIGH="high",o))(Qe||{});export{H as a,j as b,W as c,q as d,V as e,G as f,X as g,K as h,z as i,Y as j,Q as k,st as l,Z as m,J as n,ee as o,te as p,y as q,m as r,R as s,ne as t,oe as u,se as v,ae as w,ie as x,le as y,pe as z,de as A,ce as B,ue as C,ge as D,me as E,fe as F,De as G,he as H,ye as I,Ce as J,nn as K,dn as L,w as M,je as N,O,Ie as P,xn as Q,Ye as R,Qe as S};