@novu/framework 2.13.1-rc.852194fa77 → 2.13.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 (65) hide show
  1. package/dist/cjs/{agent.types-CQKSD7NC.d.cts → agent.types-crcJBtCy.d.cts} +119 -3
  2. package/dist/cjs/ai-sdk/index.d.cts +1 -1
  3. package/dist/cjs/{health-check.types-B6RuXNc8.d.cts → health-check.types-C2XZ-Tpt.d.cts} +2 -2
  4. package/dist/cjs/{index-phn3kJ9H.d.cts → index-DVSB455a.d.cts} +3 -3
  5. package/dist/cjs/index.cjs +96 -96
  6. package/dist/cjs/index.d.cts +4 -4
  7. package/dist/cjs/internal/index.cjs +36 -36
  8. package/dist/cjs/internal/index.d.cts +29 -14
  9. package/dist/cjs/langchain/index.d.cts +1 -1
  10. package/dist/cjs/servers/express.cjs +97 -97
  11. package/dist/cjs/servers/express.d.cts +5 -5
  12. package/dist/cjs/servers/h3.cjs +106 -106
  13. package/dist/cjs/servers/h3.d.cts +5 -5
  14. package/dist/cjs/servers/hono.cjs +103 -103
  15. package/dist/cjs/servers/hono.d.cts +5 -5
  16. package/dist/cjs/servers/lambda.cjs +97 -97
  17. package/dist/cjs/servers/lambda.d.cts +5 -5
  18. package/dist/cjs/servers/nest.cjs +99 -99
  19. package/dist/cjs/servers/nest.d.cts +7 -7
  20. package/dist/cjs/servers/next.cjs +116 -116
  21. package/dist/cjs/servers/next.d.cts +5 -5
  22. package/dist/cjs/servers/nuxt.cjs +106 -106
  23. package/dist/cjs/servers/nuxt.d.cts +5 -5
  24. package/dist/cjs/servers/remix.cjs +110 -110
  25. package/dist/cjs/servers/remix.d.cts +5 -5
  26. package/dist/cjs/servers/sveltekit.cjs +110 -110
  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-_eHz1E0m.d.cts → subscriber.types-BanvmGul.d.cts} +1 -1
  31. package/dist/esm/{agent.types-C17NUGxY.d.ts → agent.types-DFLG1_vb.d.ts} +119 -3
  32. package/dist/esm/ai-sdk/index.d.ts +1 -1
  33. package/dist/esm/chunk-4ETX7FIT.js +1 -0
  34. package/dist/esm/{chunk-UXO4RWZV.js → chunk-IREH6K2M.js} +2 -2
  35. package/dist/esm/{chunk-WJUYDVXH.js → chunk-PBC7WR2R.js} +46 -46
  36. package/dist/esm/{health-check.types-CL5-B_D4.d.ts → health-check.types-DORn4djx.d.ts} +2 -2
  37. package/dist/esm/{index-CYtGHJJu.d.ts → index-BvRGmHFw.d.ts} +3 -3
  38. package/dist/esm/index.d.ts +4 -4
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/internal/index.d.ts +20 -5
  41. package/dist/esm/internal/index.js +1 -1
  42. package/dist/esm/langchain/index.d.ts +1 -1
  43. package/dist/esm/servers/express.d.ts +5 -5
  44. package/dist/esm/servers/express.js +1 -1
  45. package/dist/esm/servers/h3.d.ts +5 -5
  46. package/dist/esm/servers/h3.js +1 -1
  47. package/dist/esm/servers/hono.d.ts +5 -5
  48. package/dist/esm/servers/hono.js +1 -1
  49. package/dist/esm/servers/lambda.d.ts +5 -5
  50. package/dist/esm/servers/lambda.js +1 -1
  51. package/dist/esm/servers/nest.d.ts +7 -7
  52. package/dist/esm/servers/nest.js +1 -1
  53. package/dist/esm/servers/next.d.ts +5 -5
  54. package/dist/esm/servers/next.js +1 -1
  55. package/dist/esm/servers/nuxt.d.ts +5 -5
  56. package/dist/esm/servers/nuxt.js +1 -1
  57. package/dist/esm/servers/remix.d.ts +5 -5
  58. package/dist/esm/servers/remix.js +1 -1
  59. package/dist/esm/servers/sveltekit.d.ts +5 -5
  60. package/dist/esm/servers/sveltekit.js +1 -1
  61. package/dist/esm/step-resolver.d.ts +2 -2
  62. package/dist/esm/step-resolver.js +1 -1
  63. package/dist/esm/{subscriber.types-D4PvRIKR.d.ts → subscriber.types-Drf26WPA.d.ts} +1 -1
  64. package/package.json +1 -1
  65. package/dist/esm/chunk-Q3ALQWIF.js +0 -1
@@ -1,5 +1,5 @@
1
- import { a as ContextPayload, b as Step, S as Subscriber, E as EnvironmentSystemVariables, C as ContextResolved, c as ChannelStepEnum, A as ActionStepEnum, W as WithPassthrough, d as StepOptions } from './subscriber.types-D4PvRIKR.js';
2
- import { I as ITriggerPayload, B as TriggerRecipientsPayload, C as ISubscriberPayload, D as TriggerEventStatusEnum, W as WorkflowPreferencesPartial } from './agent.types-C17NUGxY.js';
1
+ import { a as ContextPayload, b as Step, S as Subscriber, E as EnvironmentSystemVariables, C as ContextResolved, c as ChannelStepEnum, A as ActionStepEnum, W as WithPassthrough, d as StepOptions } from './subscriber.types-Drf26WPA.js';
2
+ import { I as ITriggerPayload, G as TriggerRecipientsPayload, J as ISubscriberPayload, K as TriggerEventStatusEnum, W as WorkflowPreferencesPartial } from './agent.types-DFLG1_vb.js';
3
3
  import { C as ConditionalPartial, P as PickRequiredKeys, a as Prettify, D as DeepPartial, A as Awaitable } from './util.types-DaFfsxgy.js';
4
4
  import { S as Schema, J as JsonSchema } from './base.schema.types-BApIn9jr.js';
5
5
 
@@ -1,10 +1,10 @@
1
- import { k as AgentHandlers, A as Agent, p as AgentNotification } from './agent.types-C17NUGxY.js';
2
- import { W as Workflow, L as Logger, C as ClientOptions, H as HealthCheck, e as DiscoverOutput, i as Event, n as ExecuteOutput, d as CodeResult, j as EventTriggerParams, m as Execute, t as WorkflowOptions } from './health-check.types-CL5-B_D4.js';
1
+ import { k as AgentHandlers, A as Agent, q as AgentNotification } from './agent.types-DFLG1_vb.js';
2
+ import { W as Workflow, L as Logger, C as ClientOptions, H as HealthCheck, e as DiscoverOutput, i as Event, n as ExecuteOutput, d as CodeResult, j as EventTriggerParams, m as Execute, t as WorkflowOptions } from './health-check.types-DORn4djx.js';
3
3
  import { A as Awaitable } from './util.types-DaFfsxgy.js';
4
4
  import 'chat';
5
5
  import { S as Schema, a as FromSchema, F as FromSchemaUnvalidated } from './base.schema.types-BApIn9jr.js';
6
6
  import './step-resolver.js';
7
- import './subscriber.types-D4PvRIKR.js';
7
+ import './subscriber.types-Drf26WPA.js';
8
8
 
9
9
  /**
10
10
  * Define a new conversational agent.
@@ -1,9 +1,9 @@
1
- export { C as Client, N as NovuRequestHandler, S as ServeHandlerOptions, a as agent, i as isFromWorkflow, w as workflow } from './index-CYtGHJJu.js';
2
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from './health-check.types-CL5-B_D4.js';
1
+ export { C as Client, N as NovuRequestHandler, S as ServeHandlerOptions, a as agent, i as isFromWorkflow, w as workflow } from './index-BvRGmHFw.js';
2
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from './health-check.types-DORn4djx.js';
3
3
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
4
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from './agent.types-C17NUGxY.js';
4
+ 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';
5
5
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, step } from './step-resolver.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from './subscriber.types-D4PvRIKR.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from './subscriber.types-Drf26WPA.js';
7
7
  import './util.types-DaFfsxgy.js';
8
8
  import './base.schema.types-BApIn9jr.js';
9
9
  import 'json-schema-to-ts';
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{b as m,c as q,d as r,e as u}from"./chunk-WJUYDVXH.js";import{a as v}from"./chunk-YLCLZVYS.js";import"./chunk-XIVU4VDS.js";import{N as n,O as o,P as p,W as t}from"./chunk-Q3ALQWIF.js";import{a,b,c,d,e,f,i as g,p as h,q as i,r as j}from"./chunk-X5AZIKIR.js";import"./chunk-RBTQQ5IZ.js";import{a as s}from"./chunk-UXO4RWZV.js";import{f as k}from"./chunk-VY27ZAO7.js";import{b as l}from"./chunk-PU74XQ2P.js";import"./chunk-FHYMHX3T.js";export{a as Actions,o as AgentDeliveryError,n as AgentError,b as Button,c as Card,d as CardLink,e as CardText,m as Client,k as CronExpression,f as Divider,g as Image,q as NovuRequestHandler,h as Select,i as SelectOption,t as SeverityLevelEnum,j as TextInput,r as agent,l as isFromWorkflow,s as providerSchemas,v as step,p as toAgentError,u as workflow};
1
+ import{b as m,c as q,d as r,e as u}from"./chunk-PBC7WR2R.js";import{a as v}from"./chunk-YLCLZVYS.js";import"./chunk-XIVU4VDS.js";import{N as n,O as o,P as p,W as t}from"./chunk-4ETX7FIT.js";import{a,b,c,d,e,f,i as g,p as h,q as i,r as j}from"./chunk-X5AZIKIR.js";import"./chunk-RBTQQ5IZ.js";import{a as s}from"./chunk-IREH6K2M.js";import{f as k}from"./chunk-VY27ZAO7.js";import{b as l}from"./chunk-PU74XQ2P.js";import"./chunk-FHYMHX3T.js";export{a as Actions,o as AgentDeliveryError,n as AgentError,b as Button,c as Card,d as CardLink,e as CardText,m as Client,k as CronExpression,f as Divider,g as Image,q as NovuRequestHandler,h as Select,i as SelectOption,t as SeverityLevelEnum,j as TextInput,r as agent,l as isFromWorkflow,s as providerSchemas,v as step,p as toAgentError,u as workflow};
@@ -1,10 +1,10 @@
1
- import { P as PostActionEnum } from '../health-check.types-CL5-B_D4.js';
2
- export { b as CancelEventTriggerResponse, c as ChannelPreference, C as ClientOptions, d as CodeResult, a as CronExpression, D as DiscoverAgentOutput, e as DiscoverOutput, f as DiscoverProviderOutput, g as DiscoverStepOutput, h as DiscoverWorkflowOutput, i as Event, j as EventTriggerParams, k as EventTriggerResponse, l as EventTriggerResult, m as Execute, E as ExecuteInput, n as ExecuteOutput, o as ExecuteOutputMetadata, p as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, L as Logger, S as SeverityLevelEnum, q as State, r as StepType, W as Workflow, s as WorkflowChannelEnum, t as WorkflowOptions, u as WorkflowPreference, v as WorkflowPreferences } from '../health-check.types-CL5-B_D4.js';
3
- export { e as ActionStep, A as ActionStepEnum, f as ChannelStep, c as ChannelStepEnum, g as ChatOutput, h as ChatOutputUnvalidated, i as ChatResult, a as ContextPayload, C as ContextResolved, j as ContextValue, k as CustomStep, D as DelayDynamicOutput, l as DelayDynamicOutputUnvalidated, m as DelayOutput, n as DelayOutputUnvalidated, o as DelayRegularOutput, q as DelayRegularOutputUnvalidated, r as DelayResult, s as DelayTimedOutput, t as DelayTimedOutputUnvalidated, u as DigestOutput, v as DigestOutputUnvalidated, w as DigestRegularOutput, x as DigestRegularOutputUnvalidated, y as DigestResult, z as DigestTimedOutput, B as DigestTimedOutputUnvalidated, F as EmailOutput, G as EmailOutputUnvalidated, H as EmailResult, E as EnvironmentSystemVariables, I as InAppOutput, J as InAppOutputUnvalidated, K as InAppResult, L as JobStatusEnum, P as PushOutput, M as PushOutputUnvalidated, N as PushResult, O as Skip, Q as SmsOutput, R as SmsOutputUnvalidated, T as SmsResult, b as Step, U as StepContext, d as StepOptions, V as StepOutput, S as Subscriber, X as ThrottleOutput, Y as ThrottleOutputUnvalidated, Z as ThrottleResult, _ as ToolOutput, $ as ToolOutputUnvalidated, a0 as actionStepSchemas, a1 as channelStepSchemas } from '../subscriber.types-D4PvRIKR.js';
1
+ import { P as PostActionEnum } from '../health-check.types-DORn4djx.js';
2
+ export { b as CancelEventTriggerResponse, c as ChannelPreference, C as ClientOptions, d as CodeResult, a as CronExpression, D as DiscoverAgentOutput, e as DiscoverOutput, f as DiscoverProviderOutput, g as DiscoverStepOutput, h as DiscoverWorkflowOutput, i as Event, j as EventTriggerParams, k as EventTriggerResponse, l as EventTriggerResult, m as Execute, E as ExecuteInput, n as ExecuteOutput, o as ExecuteOutputMetadata, p as ExecuteOutputOptions, G as GetActionEnum, H as HealthCheck, L as Logger, S as SeverityLevelEnum, q as State, r as StepType, W as Workflow, s as WorkflowChannelEnum, t as WorkflowOptions, u as WorkflowPreference, v as WorkflowPreferences } from '../health-check.types-DORn4djx.js';
3
+ export { e as ActionStep, A as ActionStepEnum, f as ChannelStep, c as ChannelStepEnum, g as ChatOutput, h as ChatOutputUnvalidated, i as ChatResult, a as ContextPayload, C as ContextResolved, j as ContextValue, k as CustomStep, D as DelayDynamicOutput, l as DelayDynamicOutputUnvalidated, m as DelayOutput, n as DelayOutputUnvalidated, o as DelayRegularOutput, q as DelayRegularOutputUnvalidated, r as DelayResult, s as DelayTimedOutput, t as DelayTimedOutputUnvalidated, u as DigestOutput, v as DigestOutputUnvalidated, w as DigestRegularOutput, x as DigestRegularOutputUnvalidated, y as DigestResult, z as DigestTimedOutput, B as DigestTimedOutputUnvalidated, F as EmailOutput, G as EmailOutputUnvalidated, H as EmailResult, E as EnvironmentSystemVariables, I as InAppOutput, J as InAppOutputUnvalidated, K as InAppResult, L as JobStatusEnum, P as PushOutput, M as PushOutputUnvalidated, N as PushResult, O as Skip, Q as SmsOutput, R as SmsOutputUnvalidated, T as SmsResult, b as Step, U as StepContext, d as StepOptions, V as StepOutput, S as Subscriber, X as ThrottleOutput, Y as ThrottleOutputUnvalidated, Z as ThrottleResult, _ as ToolOutput, $ as ToolOutputUnvalidated, a0 as actionStepSchemas, a1 as channelStepSchemas } from '../subscriber.types-Drf26WPA.js';
4
4
  import { Filter, LiquidOptions, Liquid } from 'liquidjs';
5
5
  import { Emoji } from 'chat';
6
- import { j as AgentHandlerContext, E as ToolResult, G as ToolApprovalRequestPayload, T as ToolApprovalCard, R as ReplyHandle, o as AgentMessageContext, H as AgentEventEnum, a as AgentAction, m as AgentMessage, r as AgentReaction, g as AgentConversation, u as AgentSubscriber, e as AgentContextPayload, p as AgentNotification, l as AgentHistoryEntry, q as AgentPlatformContext, J as TypingControl, K as ToolApprovalControl, L as AgentBridgeRequest, x as ToolApprovalConfig, M as MessageContent, F as FileRef, N as ReplyContent, S as Signal, O as AddReactionPayload, P as DeleteMessagePayload, Q as SentMessageInfo, U as TypingOp, B as TriggerRecipientsPayload } from '../agent.types-C17NUGxY.js';
7
- export { V as AgentReplyPayload, X as EditPayload, Y as MetadataSignal, Z as ParsedApprovalAction, _ as TriggerSignal, $ as buildApprovalActionId, a0 as parseApprovalActionId } from '../agent.types-C17NUGxY.js';
6
+ import { j as AgentHandlerContext, L as ToolResult, N as ToolApprovalRequestPayload, T as ToolApprovalCard, R as ReplyHandle, p as AgentMessageContext, O as AgentEventEnum, a as AgentAction, n as AgentMessage, s as AgentReaction, g as AgentConversation, v as AgentSubscriber, e as AgentContextPayload, q as AgentNotification, l as AgentHistoryEntry, r as AgentPlatformContext, m as AgentHumanResponse, P as TypingControl, Q as ToolApprovalControl, S as AgentBridgeRequest, C as ToolApprovalConfig, M as MessageContent, F as FileRef, U as ReplyContent, V as Signal, X as AddReactionPayload, Y as DeleteMessagePayload, Z as SentMessageInfo, _ as TypingOp, G as TriggerRecipientsPayload, H as HumanAskApproveOptions, y as HumanChooseOptions, B as HumanTellOptions } from '../agent.types-DFLG1_vb.js';
7
+ export { $ as AgentReplyPayload, a0 as EditPayload, a1 as HumanSignal, a2 as MetadataSignal, a3 as ParsedApprovalAction, a4 as TriggerSignal, a5 as buildApprovalActionId, a6 as parseApprovalActionId } from '../agent.types-DFLG1_vb.js';
8
8
  export { a as FromSchema, F as FromSchemaUnvalidated, J as JsonSchema, S as Schema, Z as ZodSchema, b as ZodSchemaMinimal } from '../base.schema.types-BApIn9jr.js';
9
9
  export { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
10
10
  export { A as Awaitable, C as ConditionalPartial, D as DeepPartial, b as DeepRequired, E as Either, I as Indexable, c as PickOptional, d as PickOptionalKeys, e as PickRequired, P as PickRequiredKeys, a as Prettify } from '../util.types-DaFfsxgy.js';
@@ -224,6 +224,15 @@ type AgentSignal = {
224
224
  workflowId: string;
225
225
  to?: unknown;
226
226
  payload?: Record<string, unknown>;
227
+ } | {
228
+ type: 'human';
229
+ kind: 'ask' | 'approve' | 'choose' | 'tell';
230
+ prompt: string;
231
+ requestId: string;
232
+ options?: string[];
233
+ from?: string;
234
+ ttlSeconds?: number;
235
+ to?: string | string[];
227
236
  };
228
237
  type AgentEvent = {
229
238
  type: 'run-start';
@@ -731,6 +740,7 @@ declare class AgentContextImpl implements AgentRuntimeContext {
731
740
  readonly history: AgentHistoryEntry[];
732
741
  readonly platform: string;
733
742
  readonly platformContext: AgentPlatformContext;
743
+ readonly humanResponse: AgentHumanResponse | null;
734
744
  readonly typing: TypingControl;
735
745
  readonly toolApproval: ToolApprovalControl;
736
746
  readonly metadata: {
@@ -766,6 +776,11 @@ declare class AgentContextImpl implements AgentRuntimeContext {
766
776
  to?: TriggerRecipientsPayload;
767
777
  payload?: Record<string, unknown>;
768
778
  }): void;
779
+ ask(question: string, opts?: HumanAskApproveOptions): string;
780
+ approve(action: string, opts?: HumanAskApproveOptions): string;
781
+ choose(question: string, options: string[], opts?: HumanChooseOptions): string;
782
+ tell(message: string, opts?: HumanTellOptions): string;
783
+ private queueHumanSignal;
769
784
  /** @internal Queue a gated tool call for the ledger; flushed with the next reply. */
770
785
  emitToolApprovalRequest(request: ToolApprovalRequestPayload): void;
771
786
  /** @internal Queue a tool-call outcome to be recorded in history; flushed with the next reply. */
@@ -1 +1 @@
1
- import{A as ue,B as ce,C as de,D as fe,E as xe,F as Ae,I as ye,J as Re,K as Se,L as r,M as o,Q as a,T as m,V as ve,W as Ee,a as j,b as D,c as B,d as G,e as H,f as K,g as X,h as z,i as Q,j as U,k as Y,m as Z,n as $,o as ee,p as oe,q as re,r as te,s as ne,t as ie,u as pe,v as ae,w as se,x as le,y as me,z as ge}from"../chunk-Q3ALQWIF.js";import"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{e as g,f as u}from"../chunk-UXO4RWZV.js";import{a as y,b as R,c as S,d as v,e as E,f as I,g as L,h as w,i as O,j as k,k as q,l as J,m as C,n as F,o as P,p as T,q as V,r as h,s as N,t as _,u as M,v as W,w as b}from"../chunk-VY27ZAO7.js";import{a as c,b as d,c as f}from"../chunk-QZ6TSYCK.js";import{e as s,f as l}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var Le={toSentence:r};import{jsonrepair as t}from"jsonrepair";function x(e){return t(e)}async function A(e,n,i=o()){let p=await i.parseAndRender(JSON.stringify(e),n);try{return JSON.parse(t(p))}catch{throw new Error("Rendered template output is not valid JSON")}}export{F as ActionStepEnum,m as AgentContextImpl,a as AgentEventEnum,N as BadRequestError,j as BridgeError,C as ChannelStepEnum,W as ConflictError,I as CronExpression,L as ErrorCodeEnum,G as ExecutionEventControlsInvalidError,B as ExecutionEventPayloadInvalidError,Q as ExecutionProviderOutputInvalidError,H as ExecutionStateControlsInvalidError,D as ExecutionStateCorruptError,K as ExecutionStateOutputInvalidError,X as ExecutionStateResultInvalidError,Le as FILTER_VALIDATORS,b as ForbiddenError,V as FrameworkError,R as GetActionEnum,w as HttpHeaderKeysEnum,O as HttpMethodEnum,k as HttpQueryKeysEnum,q as HttpStatusEnum,$ as InvalidActionError,ve as JobStatusEnum,Z as MethodNotAllowedError,ee as MissingSecretKeyError,h as NotFoundError,S as NovuApiEndpointsEnum,oe as PlatformError,y as PostActionEnum,pe as ProviderExecutionFailedError,ie as ProviderNotFoundError,re as ResourceConflictError,J as ResourceEnum,ne as ResourceExecutionFailed,te as ResourceNotFoundError,E as SIGNATURE_TIMESTAMP_TOLERANCE,v as SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES,M as ServerError,Ee as SeverityLevelEnum,me as SignatureExpiredError,le as SignatureInvalidError,ae as SignatureMismatchError,se as SignatureNotFoundError,ue as SignatureVersionInvalidError,ge as SigningKeyNotFoundError,de as StepAlreadyExistsError,z as StepControlCompilationFailedError,fe as StepExecutionFailedError,ce as StepNotFoundError,_ as UnauthorizedError,c as WORKFLOW_ORIGIN_LINE_MAX_CHARS,Ae as WorkflowAlreadyExistsError,P as WorkflowChannelEnum,xe as WorkflowNotFoundError,U as WorkflowPayloadInvalidError,g as actionStepSchemas,s as buildApprovalActionId,f as buildWorkflowOriginInjection,d as buildWorkflowOriginLine,u as channelStepSchemas,A as compileJsonControlValues,o as createLiquidEngine,ye as digest,Y as isFrameworkError,T as isNativeError,l as parseApprovalActionId,Re as pluralize,x as repairJsonString,Se as toSentence,r as toSentenceArgsValidator};
1
+ import{A as ue,B as ce,C as de,D as fe,E as xe,F as Ae,I as ye,J as Re,K as Se,L as r,M as o,Q as a,T as m,V as ve,W as Ee,a as j,b as D,c as H,d as B,e as G,f as K,g as X,h as z,i as Q,j as U,k as Y,m as Z,n as $,o as ee,p as oe,q as re,r as te,s as ne,t as ie,u as pe,v as ae,w as se,x as le,y as me,z as ge}from"../chunk-4ETX7FIT.js";import"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{e as g,f as u}from"../chunk-IREH6K2M.js";import{a as y,b as R,c as S,d as v,e as E,f as I,g as L,h as w,i as O,j as k,k as q,l as J,m as C,n as F,o as P,p as T,q as V,r as h,s as N,t as _,u as M,v as W,w as b}from"../chunk-VY27ZAO7.js";import{a as c,b as d,c as f}from"../chunk-QZ6TSYCK.js";import{e as s,f as l}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var Le={toSentence:r};import{jsonrepair as t}from"jsonrepair";function x(e){return t(e)}async function A(e,n,i=o()){let p=await i.parseAndRender(JSON.stringify(e),n);try{return JSON.parse(t(p))}catch{throw new Error("Rendered template output is not valid JSON")}}export{F as ActionStepEnum,m as AgentContextImpl,a as AgentEventEnum,N as BadRequestError,j as BridgeError,C as ChannelStepEnum,W as ConflictError,I as CronExpression,L as ErrorCodeEnum,B as ExecutionEventControlsInvalidError,H as ExecutionEventPayloadInvalidError,Q as ExecutionProviderOutputInvalidError,G as ExecutionStateControlsInvalidError,D as ExecutionStateCorruptError,K as ExecutionStateOutputInvalidError,X as ExecutionStateResultInvalidError,Le as FILTER_VALIDATORS,b as ForbiddenError,V as FrameworkError,R as GetActionEnum,w as HttpHeaderKeysEnum,O as HttpMethodEnum,k as HttpQueryKeysEnum,q as HttpStatusEnum,$ as InvalidActionError,ve as JobStatusEnum,Z as MethodNotAllowedError,ee as MissingSecretKeyError,h as NotFoundError,S as NovuApiEndpointsEnum,oe as PlatformError,y as PostActionEnum,pe as ProviderExecutionFailedError,ie as ProviderNotFoundError,re as ResourceConflictError,J as ResourceEnum,ne as ResourceExecutionFailed,te as ResourceNotFoundError,E as SIGNATURE_TIMESTAMP_TOLERANCE,v as SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES,M as ServerError,Ee as SeverityLevelEnum,me as SignatureExpiredError,le as SignatureInvalidError,ae as SignatureMismatchError,se as SignatureNotFoundError,ue as SignatureVersionInvalidError,ge as SigningKeyNotFoundError,de as StepAlreadyExistsError,z as StepControlCompilationFailedError,fe as StepExecutionFailedError,ce as StepNotFoundError,_ as UnauthorizedError,c as WORKFLOW_ORIGIN_LINE_MAX_CHARS,Ae as WorkflowAlreadyExistsError,P as WorkflowChannelEnum,xe as WorkflowNotFoundError,U as WorkflowPayloadInvalidError,g as actionStepSchemas,s as buildApprovalActionId,f as buildWorkflowOriginInjection,d as buildWorkflowOriginLine,u as channelStepSchemas,A as compileJsonControlValues,o as createLiquidEngine,ye as digest,Y as isFrameworkError,T as isNativeError,l as parseApprovalActionId,Re as pluralize,x as repairJsonString,Se as toSentence,r as toSentenceArgsValidator};
@@ -1,5 +1,5 @@
1
1
  import { BaseMessage } from '@langchain/core/messages';
2
- import { l as AgentHistoryEntry, j as AgentHandlerContext, M as MessageContent, k as AgentHandlers, m as AgentMessage, o as AgentMessageContext, y as ToolApprovalDecision, b as AgentActionContext, R as ReplyHandle, A as Agent } from '../agent.types-C17NUGxY.js';
2
+ import { l as AgentHistoryEntry, j as AgentHandlerContext, M as MessageContent, k as AgentHandlers, n as AgentMessage, p as AgentMessageContext, D as ToolApprovalDecision, b as AgentActionContext, R as ReplyHandle, A as Agent } from '../agent.types-DFLG1_vb.js';
3
3
  import { LanguageModelLike } from '@langchain/core/language_models/base';
4
4
  import { RunnableConfig } from '@langchain/core/runnables';
5
5
  import { StructuredToolInterface } from '@langchain/core/tools';
@@ -1,10 +1,10 @@
1
- import { S as ServeHandlerOptions } from '../index-CYtGHJJu.js';
2
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
3
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
4
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
1
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
2
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
3
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
4
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
5
5
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
6
6
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
7
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
7
+ 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';
8
8
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 N,c as a,d as k,e as i}from"../chunk-WJUYDVXH.js";import{a as F}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as R,O as V,P as b,W as $}from"../chunk-Q3ALQWIF.js";import{a as y,b as h,c,d as m,e as f,f as H,i as v,p as w,q as E,r as S}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as O}from"../chunk-UXO4RWZV.js";import{f as x}from"../chunk-VY27ZAO7.js";import{b as A}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var l="express",q=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,V as AgentDeliveryError,R as AgentError,h as Button,c as Card,m as CardLink,f as CardText,N as Client,x as CronExpression,H as Divider,v as Image,a as NovuRequestHandler,w as Select,E as SelectOption,$ as SeverityLevelEnum,S as TextInput,k as agent,l as frameworkName,A as isFromWorkflow,O as providerSchemas,q as serve,F as step,b as toAgentError,i as workflow};
1
+ import{b as N,c as a,d as k,e as i}from"../chunk-PBC7WR2R.js";import{a as F}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as R,O as V,P as b,W as $}from"../chunk-4ETX7FIT.js";import{a as y,b as h,c,d as m,e as f,f as H,i as v,p as w,q as E,r as S}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as O}from"../chunk-IREH6K2M.js";import{f as x}from"../chunk-VY27ZAO7.js";import{b as A}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var l="express",q=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,V as AgentDeliveryError,R as AgentError,h as Button,c as Card,m as CardLink,f as CardText,N as Client,x as CronExpression,H as Divider,v as Image,a as NovuRequestHandler,w as Select,E as SelectOption,$ as SeverityLevelEnum,S as TextInput,k as agent,l as frameworkName,A as isFromWorkflow,O as providerSchemas,q as serve,F as step,b as toAgentError,i 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-CYtGHJJu.js';
4
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
5
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
3
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
4
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
5
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
7
7
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
8
8
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
9
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
9
+ 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';
10
10
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 F,e as C}from"../chunk-WJUYDVXH.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as O,O as b,P as q,W as B}from"../chunk-Q3ALQWIF.js";import{a as l,b as y,c as H,d as S,e as i,f,i as g,p as N,q as w,r as c}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as $}from"../chunk-UXO4RWZV.js";import{f as E}from"../chunk-VY27ZAO7.js";import{b as k}from"../chunk-PU74XQ2P.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",R=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,b as AgentDeliveryError,O as AgentError,y as Button,H as Card,S as CardLink,i as CardText,x as Client,E as CronExpression,f as Divider,g as Image,t as NovuRequestHandler,N as Select,w as SelectOption,B as SeverityLevelEnum,c as TextInput,F as agent,h as frameworkName,k as isFromWorkflow,$ as providerSchemas,R as serve,D as step,q as toAgentError,C as workflow};
1
+ import{b as x,c as t,d as F,e as C}from"../chunk-PBC7WR2R.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as O,O as b,P as q,W as B}from"../chunk-4ETX7FIT.js";import{a as l,b as y,c as H,d as S,e as i,f,i as g,p as N,q as w,r as c}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as $}from"../chunk-IREH6K2M.js";import{f as E}from"../chunk-VY27ZAO7.js";import{b as k}from"../chunk-PU74XQ2P.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",R=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,b as AgentDeliveryError,O as AgentError,y as Button,H as Card,S as CardLink,i as CardText,x as Client,E as CronExpression,f as Divider,g as Image,t as NovuRequestHandler,N as Select,w as SelectOption,B as SeverityLevelEnum,c as TextInput,F as agent,h as frameworkName,k as isFromWorkflow,$ as providerSchemas,R as serve,D as step,q as toAgentError,C as workflow};
@@ -1,11 +1,11 @@
1
1
  import { Context } from 'hono';
2
- import { S as ServeHandlerOptions } from '../index-CYtGHJJu.js';
3
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
5
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
2
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
3
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
5
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
6
6
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
7
7
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
8
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
8
+ 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';
9
9
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 s,b as C,c as p,d as k,e as g}from"../chunk-WJUYDVXH.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as U,O as E,P as S,W as O}from"../chunk-Q3ALQWIF.js";import{a as m,b as h,c as l,d as c,e as f,f as x,i as w,p as y,q,r as v}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as H}from"../chunk-UXO4RWZV.js";import{f as N}from"../chunk-VY27ZAO7.js";import{b as R}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var u="hono",d=o=>{try{let n=o.executionCtx;if(typeof n.waitUntil=="function")return e=>n.waitUntil(e)}catch{}},P=o=>new p({frameworkName:u,...o,handler:e=>({body:()=>e.req.json(),waitUntil:d(e),headers:t=>e.req.header(t),method:()=>e.req.method,queryString:t=>e.req.query(t),url:()=>{try{return new URL(e.req.url)}catch{}let t=e.req.header("host")||"localhost",r="https";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(r="http")}catch{}return new URL(e.req.url,`${r}://${t}`)},transformResponse:({body:t,status:r,headers:a})=>{let i=s();return new i(t,{status:r,headers:a})}})}).createHandler();export{m as Actions,E as AgentDeliveryError,U as AgentError,h as Button,l as Card,c as CardLink,f as CardText,C as Client,N as CronExpression,x as Divider,w as Image,p as NovuRequestHandler,y as Select,q as SelectOption,O as SeverityLevelEnum,v as TextInput,k as agent,u as frameworkName,R as isFromWorkflow,H as providerSchemas,P as serve,D as step,S as toAgentError,g as workflow};
1
+ import{a as s,b as C,c as p,d as k,e as g}from"../chunk-PBC7WR2R.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as U,O as E,P as S,W as O}from"../chunk-4ETX7FIT.js";import{a as m,b as h,c as l,d as c,e as f,f as x,i as w,p as y,q,r as v}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as H}from"../chunk-IREH6K2M.js";import{f as N}from"../chunk-VY27ZAO7.js";import{b as R}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var u="hono",d=o=>{try{let n=o.executionCtx;if(typeof n.waitUntil=="function")return e=>n.waitUntil(e)}catch{}},P=o=>new p({frameworkName:u,...o,handler:e=>({body:()=>e.req.json(),waitUntil:d(e),headers:t=>e.req.header(t),method:()=>e.req.method,queryString:t=>e.req.query(t),url:()=>{try{return new URL(e.req.url)}catch{}let t=e.req.header("host")||"localhost",r="https";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(r="http")}catch{}return new URL(e.req.url,`${r}://${t}`)},transformResponse:({body:t,status:r,headers:a})=>{let i=s();return new i(t,{status:r,headers:a})}})}).createHandler();export{m as Actions,E as AgentDeliveryError,U as AgentError,h as Button,l as Card,c as CardLink,f as CardText,C as Client,N as CronExpression,x as Divider,w as Image,p as NovuRequestHandler,y as Select,q as SelectOption,O as SeverityLevelEnum,v as TextInput,k as agent,u as frameworkName,R as isFromWorkflow,H as providerSchemas,P as serve,D as step,S as toAgentError,g 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-CYtGHJJu.js';
4
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
5
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
3
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
4
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
5
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
7
7
  import { E as Either } from '../util.types-DaFfsxgy.js';
8
8
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
9
9
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
10
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
10
+ 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';
11
11
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 A,c as n,d as q,e as H}from"../chunk-WJUYDVXH.js";import{a as N}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as G,O as S,P as b,W as V}from"../chunk-Q3ALQWIF.js";import{a as m,b as u,c as P,d as h,e as i,f as w,i as l,p as f,q as x,r as c}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as g}from"../chunk-UXO4RWZV.js";import{f as E}from"../chunk-VY27ZAO7.js";import{b as I}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var p="lambda",k=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,S as AgentDeliveryError,G as AgentError,u as Button,P as Card,h as CardLink,i as CardText,A as Client,E as CronExpression,w as Divider,l as Image,n as NovuRequestHandler,f as Select,x as SelectOption,V as SeverityLevelEnum,c as TextInput,q as agent,p as frameworkName,I as isFromWorkflow,g as providerSchemas,k as serve,N as step,b as toAgentError,H as workflow};
1
+ import{b as A,c as n,d as q,e as H}from"../chunk-PBC7WR2R.js";import{a as N}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as G,O as S,P as b,W as V}from"../chunk-4ETX7FIT.js";import{a as m,b as u,c as P,d as h,e as i,f as w,i as l,p as f,q as x,r as c}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as g}from"../chunk-IREH6K2M.js";import{f as E}from"../chunk-VY27ZAO7.js";import{b as I}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var p="lambda",k=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,S as AgentDeliveryError,G as AgentError,u as Button,P as Card,h as CardLink,i as CardText,A as Client,E as CronExpression,w as Divider,l as Image,n as NovuRequestHandler,f as Select,x as SelectOption,V as SeverityLevelEnum,c as TextInput,q as agent,p as frameworkName,I as isFromWorkflow,g as providerSchemas,k as serve,N as step,b as toAgentError,H as workflow};
@@ -1,12 +1,12 @@
1
- import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-CYtGHJJu.js';
2
- export { a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
3
- import { W as Workflow } from '../health-check.types-CL5-B_D4.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-CL5-B_D4.js';
1
+ import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-BvRGmHFw.js';
2
+ export { a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
3
+ import { W as Workflow } from '../health-check.types-DORn4djx.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-DORn4djx.js';
5
5
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
6
- import { A as Agent } from '../agent.types-C17NUGxY.js';
7
- export { 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
6
+ import { A as Agent } from '../agent.types-DFLG1_vb.js';
7
+ export { 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';
8
8
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, step } from '../step-resolver.js';
9
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
9
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
10
10
  import { Request, Response } from 'express';
11
11
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
12
12
  import { VercelRequest, VercelResponse } from '@vercel/node';
@@ -1 +1 @@
1
- import{b as W,c as P,d as re,e as se}from"../chunk-WJUYDVXH.js";import{a as pe}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as X,O as Z,P as ee,W as oe}from"../chunk-Q3ALQWIF.js";import{a as j,b as F,c as L,d as V,e as U,f as k,i as B,p as $,q as K,r as z}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as te}from"../chunk-UXO4RWZV.js";import{f as J}from"../chunk-VY27ZAO7.js";import{b as Q}from"../chunk-PU74XQ2P.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:ne,ASYNC_OPTIONS_TYPE:ie}=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,Z as AgentDeliveryError,X as AgentError,F as Button,L as Card,V as CardLink,U as CardText,W as Client,J as CronExpression,k as Divider,B as Image,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,$ as Select,K as SelectOption,oe as SeverityLevelEnum,z as TextInput,re as agent,q as frameworkName,Q as isFromWorkflow,te as providerSchemas,R as registerApiPath,v as registerControllerDecorators,pe as step,ee as toAgentError,se as workflow};
1
+ import{b as W,c as P,d as re,e as se}from"../chunk-PBC7WR2R.js";import{a as pe}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as X,O as Z,P as ee,W as oe}from"../chunk-4ETX7FIT.js";import{a as j,b as F,c as L,d as V,e as U,f as k,i as B,p as $,q as K,r as z}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as te}from"../chunk-IREH6K2M.js";import{f as J}from"../chunk-VY27ZAO7.js";import{b as Q}from"../chunk-PU74XQ2P.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:ne,ASYNC_OPTIONS_TYPE:ie}=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,Z as AgentDeliveryError,X as AgentError,F as Button,L as Card,V as CardLink,U as CardText,W as Client,J as CronExpression,k as Divider,B as Image,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,$ as Select,K as SelectOption,oe as SeverityLevelEnum,z as TextInput,re as agent,q as frameworkName,Q as isFromWorkflow,te as providerSchemas,R as registerApiPath,v as registerControllerDecorators,pe as step,ee as toAgentError,se as workflow};
@@ -1,11 +1,11 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { S as ServeHandlerOptions } from '../index-CYtGHJJu.js';
3
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
5
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
2
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
3
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
5
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
6
6
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
7
7
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
8
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
8
+ 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';
9
9
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 c,b as k,c as f,d as L,e as V}from"../chunk-WJUYDVXH.js";import{a as W}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as j,O as G,P as I,W as D}from"../chunk-Q3ALQWIF.js";import{a as S,b as q,c as w,d as P,e as T,f as v,i as A,p as E,q as b,r as g}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as $}from"../chunk-UXO4RWZV.js";import{f as F}from"../chunk-VY27ZAO7.js";import{b as U}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";import*as l from"next/server.js";var N="next",y=()=>{if(typeof l.after=="function")return r=>{try{l.after(r)}catch{}}},H=r=>typeof r=="object"&&r!==null&&typeof r.setHeader=="function"&&typeof r.status=="function"&&typeof r.send=="function",B=r=>{let i=new f({frameworkName:N,...r,handler:(h,R,d)=>{let n=R,p=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,waitUntil:y(),headers:p,method:()=>h||n.method||"",queryString:(e,t)=>{var a;let o=((a=n.query)==null?void 0:a[e])||t.searchParams.get(e);return Array.isArray(o)?o[0]:o},url:()=>{let e;try{e=new URL(n.url)}catch{}if(e){let s=p("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",o=p("host")||"";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(t="http")}catch{}return new URL(n.url,`${t}://${o}`)},transformResponse:({body:e,headers:t,status:o})=>{if(H(d)){Object.entries(t).forEach(([s,u])=>{d.setHeader(s,u)}),d.status(o).send(e);return}let a=c();return new a(e,{status:o,headers:t})}}}}).createHandler(),m=i.bind(null,void 0);return Object.defineProperties(m,{GET:{value:i.bind(null,"GET")},POST:{value:i.bind(null,"POST")},OPTIONS:{value:i.bind(null,"OPTIONS")}})};export{S as Actions,G as AgentDeliveryError,j as AgentError,q as Button,w as Card,P as CardLink,T as CardText,k as Client,F as CronExpression,v as Divider,A as Image,f as NovuRequestHandler,E as Select,b as SelectOption,D as SeverityLevelEnum,g as TextInput,L as agent,N as frameworkName,U as isFromWorkflow,$ as providerSchemas,B as serve,W as step,I as toAgentError,V as workflow};
1
+ import{a as c,b as k,c as f,d as L,e as V}from"../chunk-PBC7WR2R.js";import{a as W}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as j,O as G,P as I,W as D}from"../chunk-4ETX7FIT.js";import{a as S,b as q,c as w,d as P,e as T,f as v,i as A,p as E,q as b,r as g}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as $}from"../chunk-IREH6K2M.js";import{f as F}from"../chunk-VY27ZAO7.js";import{b as U}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";import*as l from"next/server.js";var N="next",y=()=>{if(typeof l.after=="function")return r=>{try{l.after(r)}catch{}}},H=r=>typeof r=="object"&&r!==null&&typeof r.setHeader=="function"&&typeof r.status=="function"&&typeof r.send=="function",B=r=>{let i=new f({frameworkName:N,...r,handler:(h,R,d)=>{let n=R,p=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,waitUntil:y(),headers:p,method:()=>h||n.method||"",queryString:(e,t)=>{var a;let o=((a=n.query)==null?void 0:a[e])||t.searchParams.get(e);return Array.isArray(o)?o[0]:o},url:()=>{let e;try{e=new URL(n.url)}catch{}if(e){let s=p("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",o=p("host")||"";try{(process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev")&&(t="http")}catch{}return new URL(n.url,`${t}://${o}`)},transformResponse:({body:e,headers:t,status:o})=>{if(H(d)){Object.entries(t).forEach(([s,u])=>{d.setHeader(s,u)}),d.status(o).send(e);return}let a=c();return new a(e,{status:o,headers:t})}}}}).createHandler(),m=i.bind(null,void 0);return Object.defineProperties(m,{GET:{value:i.bind(null,"GET")},POST:{value:i.bind(null,"POST")},OPTIONS:{value:i.bind(null,"OPTIONS")}})};export{S as Actions,G as AgentDeliveryError,j as AgentError,q as Button,w as Card,P as CardLink,T as CardText,k as Client,F as CronExpression,v as Divider,A as Image,f as NovuRequestHandler,E as Select,b as SelectOption,D as SeverityLevelEnum,g as TextInput,L as agent,N as frameworkName,U as isFromWorkflow,$ as providerSchemas,B as serve,W as step,I as toAgentError,V 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-CYtGHJJu.js';
4
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
5
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
6
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
3
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
4
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
5
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
6
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
7
7
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
8
8
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
9
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
9
+ 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';
10
10
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 k,c as t,d as F,e as C}from"../chunk-WJUYDVXH.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as O,O as b,P as q,W as B}from"../chunk-Q3ALQWIF.js";import{a as l,b as H,c as S,d as i,e as y,f,i as g,p as N,q as w,r as c}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as $}from"../chunk-UXO4RWZV.js";import{f as x}from"../chunk-VY27ZAO7.js";import{b as E}from"../chunk-PU74XQ2P.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",U=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,b as AgentDeliveryError,O as AgentError,H as Button,S as Card,i as CardLink,y as CardText,k as Client,x as CronExpression,f as Divider,g as Image,t as NovuRequestHandler,N as Select,w as SelectOption,B as SeverityLevelEnum,c as TextInput,F as agent,u as frameworkName,E as isFromWorkflow,$ as providerSchemas,U as serve,D as step,q as toAgentError,C as workflow};
1
+ import{b as k,c as t,d as F,e as C}from"../chunk-PBC7WR2R.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as O,O as b,P as q,W as B}from"../chunk-4ETX7FIT.js";import{a as l,b as H,c as S,d as i,e as y,f,i as g,p as N,q as w,r as c}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as $}from"../chunk-IREH6K2M.js";import{f as x}from"../chunk-VY27ZAO7.js";import{b as E}from"../chunk-PU74XQ2P.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",U=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,b as AgentDeliveryError,O as AgentError,H as Button,S as Card,i as CardLink,y as CardText,k as Client,x as CronExpression,f as Divider,g as Image,t as NovuRequestHandler,N as Select,w as SelectOption,B as SeverityLevelEnum,c as TextInput,F as agent,u as frameworkName,E as isFromWorkflow,$ as providerSchemas,U as serve,D as step,q as toAgentError,C as workflow};
@@ -1,10 +1,10 @@
1
- import { S as ServeHandlerOptions } from '../index-CYtGHJJu.js';
2
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
3
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
4
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
1
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
2
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
3
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
4
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
5
5
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
6
6
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
7
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
7
+ 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';
8
8
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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 N,c as o,d as q,e as b}from"../chunk-WJUYDVXH.js";import{a as j}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as S,O as g,P as y,W as O}from"../chunk-Q3ALQWIF.js";import{a as u,b as h,c as l,d as R,e as c,f as i,i as w,p as f,q as x,r as k}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as F}from"../chunk-UXO4RWZV.js";import{f as v}from"../chunk-VY27ZAO7.js";import{b as H}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var m="remix",U=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,g as AgentDeliveryError,S as AgentError,h as Button,l as Card,R as CardLink,c as CardText,N as Client,v as CronExpression,i as Divider,w as Image,o as NovuRequestHandler,f as Select,x as SelectOption,O as SeverityLevelEnum,k as TextInput,q as agent,m as frameworkName,H as isFromWorkflow,F as providerSchemas,U as serve,j as step,y as toAgentError,b as workflow};
1
+ import{a as t,b as N,c as o,d as q,e as b}from"../chunk-PBC7WR2R.js";import{a as j}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as S,O as g,P as y,W as O}from"../chunk-4ETX7FIT.js";import{a as u,b as h,c as l,d as R,e as c,f as i,i as w,p as f,q as x,r as k}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as F}from"../chunk-IREH6K2M.js";import{f as v}from"../chunk-VY27ZAO7.js";import{b as H}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var m="remix",U=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,g as AgentDeliveryError,S as AgentError,h as Button,l as Card,R as CardLink,c as CardText,N as Client,v as CronExpression,i as Divider,w as Image,o as NovuRequestHandler,f as Select,x as SelectOption,O as SeverityLevelEnum,k as TextInput,q as agent,m as frameworkName,H as isFromWorkflow,F as providerSchemas,U as serve,j as step,y as toAgentError,b as workflow};
@@ -1,11 +1,11 @@
1
1
  import { RequestEvent } from '@sveltejs/kit';
2
- import { S as ServeHandlerOptions } from '../index-CYtGHJJu.js';
3
- export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-CYtGHJJu.js';
4
- export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-CL5-B_D4.js';
5
- export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-D4PvRIKR.js';
2
+ import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js';
3
+ export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js';
4
+ export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js';
5
+ export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js';
6
6
  import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
7
7
  export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat';
8
- 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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentNotification, q as AgentPlatformContext, r as AgentReaction, s as AgentReactionContext, t as AgentResolveContext, u as AgentSubscriber, v as AgentSubscriberAccess, w as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, x as ToolApprovalConfig, y as ToolApprovalDecision, z as toAgentError } from '../agent.types-C17NUGxY.js';
8
+ 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';
9
9
  export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, 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,c as s,d as I,e as g}from"../chunk-WJUYDVXH.js";import{a as x}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as w,O as y,P as G,W as H}from"../chunk-Q3ALQWIF.js";import{a as v,b as E,c as P,d as R,e as T,f as S,i as c,p as f,q as h,r as N}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as k}from"../chunk-UXO4RWZV.js";import{f as q}from"../chunk-VY27ZAO7.js";import{b as F}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var m="sveltekit",V=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,y as AgentDeliveryError,w as AgentError,E as Button,P as Card,R as CardLink,T as CardText,b as Client,q as CronExpression,S as Divider,c as Image,s as NovuRequestHandler,f as Select,h as SelectOption,H as SeverityLevelEnum,N as TextInput,I as agent,m as frameworkName,F as isFromWorkflow,k as providerSchemas,V as serve,x as step,G as toAgentError,g as workflow};
1
+ import{a as r,b,c as s,d as I,e as g}from"../chunk-PBC7WR2R.js";import{a as x}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{N as w,O as y,P as G,W as H}from"../chunk-4ETX7FIT.js";import{a as v,b as E,c as P,d as R,e as T,f as S,i as c,p as f,q as h,r as N}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as k}from"../chunk-IREH6K2M.js";import{f as q}from"../chunk-VY27ZAO7.js";import{b as F}from"../chunk-PU74XQ2P.js";import"../chunk-FHYMHX3T.js";var m="sveltekit",V=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,y as AgentDeliveryError,w as AgentError,E as Button,P as Card,R as CardLink,T as CardText,b as Client,q as CronExpression,S as Divider,c as Image,s as NovuRequestHandler,f as Select,h as SelectOption,H as SeverityLevelEnum,N as TextInput,I as agent,m as frameworkName,F as isFromWorkflow,k as providerSchemas,V as serve,x as step,G as toAgentError,g 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, $ as ToolOutputUnvalidated, n as DelayOutputUnvalidated, v as DigestOutputUnvalidated, Y as ThrottleOutputUnvalidated } from './subscriber.types-D4PvRIKR.js';
2
- export { a0 as actionStepSchemas, a1 as channelStepSchemas } from './subscriber.types-D4PvRIKR.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, $ as ToolOutputUnvalidated, n as DelayOutputUnvalidated, v as DigestOutputUnvalidated, Y as ThrottleOutputUnvalidated } from './subscriber.types-Drf26WPA.js';
2
+ export { a0 as actionStepSchemas, a1 as channelStepSchemas } from './subscriber.types-Drf26WPA.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 'chat';
@@ -1 +1 @@
1
- import{a as o}from"./chunk-YLCLZVYS.js";import{a as e,e as t,f as r}from"./chunk-UXO4RWZV.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-YLCLZVYS.js";import{a as e,e as t,f as r}from"./chunk-IREH6K2M.js";import"./chunk-FHYMHX3T.js";export{t as actionStepSchemas,r as channelStepSchemas,e as providerSchemas,o as step};
@@ -181,7 +181,7 @@ declare const providerSchemas: {
181
181
  readonly additionalProperties: true;
182
182
  };
183
183
  };
184
- readonly 'novu-agent-chat': {
184
+ readonly 'novu-web-chat': {
185
185
  output: {
186
186
  readonly type: "object";
187
187
  readonly properties: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novu/framework",
3
- "version": "2.13.1-rc.852194fa77",
3
+ "version": "2.13.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",
@@ -1 +0,0 @@
1
- import{a as B,b as j,c as q,d as H,e as W,f as V,g as G,h as K,i as X,j as z,k as Y,l as J,m as Q,n as Z,o as ee,p as te,q as ne,r as re}from"./chunk-X5AZIKIR.js";import{d as oe,g as m,i as se,q as ae,r as ie,s as g,t as R,u as _,v as le}from"./chunk-VY27ZAO7.js";import{a as pe,c as de,g as ue}from"./chunk-PU74XQ2P.js";var ce=class extends _{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var me=class extends g{constructor(n,o){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${o}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:o}}},fe=class extends g{constructor(n,o){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=o}},he=class extends g{constructor(n,o){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=o}},ye=class extends g{constructor(n,o,r){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${o}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=r}},Re=class extends g{constructor(n,o,r){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${o}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=r}},ve=class extends g{constructor(n,o,r){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${o}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=r}},Se=class extends g{constructor(n,o,r){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${o}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=r}},Ae=class extends g{constructor(n,o,r,s){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${o}\` and provider with id: \`${r}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=s}},xe=class extends g{constructor(n,o){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=o}};var Te=t=>Object.values(m).includes(t==null?void 0:t.code),Wt=t=>!Te(t)&&typeof t.statusCode=="number"&&t.statusCode>=400&&t.statusCode<500;var k=t=>Object.values(t).map(e=>`\`${e}\``).join(", "),C=t=>t.replaceAll(/(\w)(\w*)/g,(e,n,o)=>n.toUpperCase()+o.toLowerCase()).replaceAll(/[\s-]+/g,"");var Ee=class extends ae{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${k(se)}`}},_e=class extends g{constructor(n,o){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${k(o)}`);this.code="InvalidActionError"}},Ce=class extends g{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var we=class extends Error{constructor(e,n,o){super(),this.data={message:o},this.statusCode=e,this.code=n}};var v=class extends le{constructor(e,n){super(`${C(e)} with id: \`${n}\` already exists. Please use a different id.`)}},h=class extends ie{constructor(e,n){super(`${C(e)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},S=class extends _{constructor(n,o,r,s){super(`Failed to ${r} ${C(n)} with id: \`${o}\``,{cause:s});this.statusCode=502}};var Oe=class extends h{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},Ie=class extends S{constructor(n,o,r){super("provider",n,o,r);this.code="ProviderExecutionFailedError"}};var Pe=class extends R{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"}},ke=class extends R{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},Ne=class extends R{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},Ue=class extends R{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},Fe=class extends R{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}},De=class extends R{constructor(){super("Signature version is invalid. Please provide a signature version with version `v1` in the `novu-signature` header");this.code="SignatureVersionInvalidError"}};var Me=class extends h{constructor(n){super("step",n);this.code="StepNotFoundError"}},$e=class extends v{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Le=class extends S{constructor(n,o,r){super("step",n,o,r);this.code="StepExecutionFailedError"}};var Be=class extends h{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}},je=class extends v{constructor(n){super("workflow",n);this.code="WorkflowAlreadyExistsError"}};function ut(t,e){let n={...t};for(let o of Object.keys(e)){let r=e[o];r&&typeof r=="object"&&!Array.isArray(r)?n[o]=ut(n[o]||{},r):(Array.isArray(r),n[o]=r)}return n}function w(t,e){let n=e.split(".").reduce((o,r)=>{if(o&&typeof o=="object")return o[r]},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 o=JSON.stringify(n);return o==="{}"?"":o}return""}function qe(t,e=2,n,o=", "){if(!Array.isArray(t)||t.length===0)return"";let r=n?t.map(a=>typeof a!="object"||!a?"":w(a,n)):t;if(r.length===1)return r[0];if(r.length===2)return`${r[0]} and ${r[1]}`;if(e>=r.length){let a=r.slice(0,-1),l=r[r.length-1];return`${a.join(o)} and ${l}`}let s=r.slice(0,e),d=r.length-e;return`${s.join(o)} and ${d} ${d===1?"other":"others"}`}import ct from"pluralize";function He(t,e="",n="",o="true"){if(t==null)return"";let r=0;if(Array.isArray(t)?r=t.length:typeof t=="object"?r=Object.keys(t).length:typeof t=="string"?r=+t:typeof t=="number"?r=t:r=Number(t),Number.isNaN(r)&&(r=0),r<=0)return"";let s;return n?s=r===1?e:n:s=ct(e,r),o==="true"?`${r} ${s}`:s}import{TokenKind as We}from"liquidjs";import gt from"pluralize";import{z as y}from"zod";var Ge="",Ke=2,Xe="other",ze=", ",Ye=" and ",Je=", and ",Ve={0:"keyPath",1:"limit",2:"overflowSuffix",3:"wordsConnector",4:"twoWordsConnector",5:"lastWordConnector"};function Qe(t,e=Ge,n=Ke,o=Xe,r=ze,s=Ye,d=Je){if(!Array.isArray(t)||t.length===0)return"";let a=e?t.map(c=>typeof c!="object"||!c?"":w(c,e)):t,l=a.length;if(l===1)return a[0];if(l===2)return`${a[0]}${s}${a[1]}`;if(n>=l){let c=a.slice(0,l-1),L=a[l-1];return`${c.join(r)}${d}${L}`}let i=a.slice(0,n),u=l-n,p=n===1?s:d;return`${i.join(r)}${p}${u} ${gt(o,u)}`}function qn(t={},...e){let{requireKeyPath:n=!1}=t,o=[];if(e.length<1)return o.push({message:"Expected at least 1 argument",begin:0,end:0,value:""}),o;let r=y.object({keyPath:n?y.string().min(1,"must be non-empty"):y.string().optional().default(Ge),limit:y.number().optional().default(Ke).refine(a=>a>=0,"must be greater than or equal to 0"),overflowSuffix:y.string().optional().default(Xe),wordsConnector:y.string().optional().default(ze),twoWordsConnector:y.string().optional().default(Ye),lastWordConnector:y.string().optional().default(Je)}),s={};e.forEach((a,l)=>{if(!Array.isArray(a)){let i=a.getText();(a.kind===We.Quoted||a.kind===We.Number)&&(i=a.content);let u=Ve[l];s[u]=i}});let d=r.safeParse(s);if(!d.success)for(let a of d.error.issues){let l="string";"type"in a&&(l=a.type);let i=a.path[0],u=Object.entries(Ve).find(([L,dt])=>dt===i),p=u?parseInt(u[0],10):null,c=typeof p=="number"?e[p]:null;c&&!Array.isArray(c)&&o.push({message:`"toSentence" expects a ${l}${a.message?` that ${a.message}`:""} for argument "${i}"`,begin:c.begin,end:c.end,value:c.getText()})}return o}import{Liquid as mt}from"liquidjs";function ft(t){return Array.isArray(t)||typeof t=="object"&&t!==null?Ze(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 Ze=(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 zn(t){let e=new mt({outputEscape:ft,...t});return e.registerFilter("json",(n,o)=>Ze(n,o)),e.registerFilter("digest",qe),e.registerFilter("toSentence",Qe),e.registerFilter("pluralize",He),e}var ht={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 O(t){return typeof t=="string"&&t.trim()?t:!t||typeof t!="object"?null:O(t.message)}function yt(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,o=O(n.message);if(o)return o;let r=O(n.error);if(r)return r;let s=n.errors;return Array.isArray(s)?O(s[0]):null}function Rt(t,e){var r;let n=(r=ht[t])!=null?r:t,o=yt(e);return o?`Delivery failed: ${n}: ${o}`:`Delivery failed: ${n}`}var A=class extends Error{constructor(e,n){super(e),this.name="AgentError",this.cause=n==null?void 0:n.cause,this.delivery=n==null?void 0:n.delivery}},f=class extends A{constructor(e,n){let o={statusCode:e,responseBody:n};super(Rt(e,n),{delivery:o}),this.name="AgentDeliveryError",this.statusCode=e,this.responseBody=n}};function Jn(t){return t instanceof A?t:t instanceof Error?new A(t.message,{cause:t}):new A("Turn failed",{cause:t})}var vt=(r=>(r.ON_MESSAGE="onMessage",r.ON_ACTION="onAction",r.ON_RESOLVE="onResolve",r.ON_REACTION="onReaction",r))(vt||{}),I=class{constructor(){this.__novuPendingApproval=!0}};function Zn(t){return typeof t=="object"&&t!==null&&"suppress"in t&&t.suppress===!0}var et=1;function St(t){return new Promise(e=>{setTimeout(e,t)})}function At(t){return t>=500||t===408||t===429}var b=class{constructor(e){this.sequence=0;this.buffer=[];this.chain=Promise.resolve();var n,o;this.runId=`run_${crypto.randomUUID()}`,this.eventsUrl=e.eventsUrl,this.secretKey=e.secretKey,this.conversationId=e.conversationId,this.agentId=e.agentId,this.turnId=e.turnId,this.fetchFn=(n=e.fetchFn)!=null?n:fetch,this.maxRetries=(o=e.maxRetries)!=null?o:3}enqueue(e){this.sequence+=1,this.buffer.push({version:et,conversationId:this.conversationId,agentId:this.agentId,runId:this.runId,turnId:this.turnId,sequence:this.sequence,timestamp:new Date().toISOString(),event:e})}flush(){if(this.buffer.length===0)return this.chain;let e=this.buffer;return this.buffer=[],this.chain=this.chain.then(()=>this.postBatchWithRetry(e)),this.chain}async emit(e){this.enqueue(e),await this.flush()}async postBatchWithRetry(e){let n;for(let o=1;o<=this.maxRetries;o+=1)try{await this.postBatch(e);return}catch(r){if(n=r,!xt(r))throw r;o<this.maxRetries&&await St(250*o)}throw n}async postBatch(e){let n;try{n=await this.fetchFn(this.eventsUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${this.secretKey}`},body:JSON.stringify({events:e})})}catch(r){throw Tt(r)}let o=await n.text().catch(()=>"");if(!n.ok)throw new f(n.status,o)}};function xt(t){return!(t instanceof f)||t.statusCode===0?!0:At(t.statusCode)}function Tt(t){if(t instanceof f)return t;let e=t instanceof Error?t.message:"Network request failed";return new f(0,e)}var Et=Symbol.for("chat.jsx.element"),_t=new Set([B,j,q,H,W,V,Q,G,K,X,z,Z,ee,Y,te,ne,J,re]);function Ct(t){return typeof t=="object"&&t!==null&&t.$$typeof===Et}async function tt(t){let e=P(t);if(e&&typeof e=="object"&&pe(e))return e;let{isJSX:n,toCardElement:o}=await import("./jsx-runtime-5ZWEWA4A.js");return n(e)?o(e):null}function P(t){var e;if(Array.isArray(t))return t.map(n=>P(n));if(!Ct(t))return t;if(typeof t.type=="function"&&!_t.has(t.type)){let n={...(e=t.props)!=null?e:{}};return t.children!==void 0&&(n.children=t.children),P(t.type(n))}return{...t,children:P(t.children)}}var wt=5*1024*1024,Ot=5*1024*1024,nt=32768,It=/^[A-Za-z0-9+/]*={0,2}$/;function E(t,e){return t.filename?`"${t.filename}"`:`at index ${e}`}function it(){return globalThis.Buffer}function bt(t){var e,n,o;return(o=(n=(e=it())==null?void 0:e.isBuffer)==null?void 0:n.call(e,t))!=null?o:!1}function Pt(t){return typeof Blob!="undefined"&&t instanceof Blob}function N(t){let e=it();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 o=0;o<t.length;o+=nt){let r=t.subarray(o,o+nt);n+=String.fromCharCode(...r)}return btoa(n)}function lt(t){let e=t.replace(/\s/g,""),n=e.length%4;if(!e||n===1||!It.test(e))return null;let o=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-o}function x(t,e,n){if(t>wt)throw new Error(`Invalid file ${E(e,n)}: inline data must be 5 MB or smaller. Use a publicly-accessible URL for larger files.`)}async function kt(t,e,n){if(typeof t=="string"){let o=lt(t);if(o===null)throw new Error(`Invalid file ${E(e,n)}: data must be a base64-encoded string.`);return x(o,e,n),t}if(bt(t))return x(t.byteLength,e,n),t.toString("base64");if(t instanceof Uint8Array)return x(t.byteLength,e,n),N(t);if(t instanceof ArrayBuffer)return x(t.byteLength,e,n),N(new Uint8Array(t));if(Pt(t))return x(t.size,e,n),N(new Uint8Array(await t.arrayBuffer()));throw new Error(`Invalid file ${E(e,n)}: data must be a base64 string, Buffer, Uint8Array, ArrayBuffer, or Blob.`)}async function Nt(t){if(!(t!=null&&t.length))return;let e=[],n=0;for(let[o,r]of t.entries()){let s=r.data,d=r.url,a=s!=null,l=d!=null;if(a===l)throw new Error(`Invalid file ${E(r,o)}: provide exactly one of data or url.`);if(a){let i=await kt(s,r,o),u=lt(i);if(n+=u!=null?u:0,n>Ot)throw new Error("Invalid files: total inline data must be 5 MB or smaller. Use publicly-accessible URLs for larger files.");e.push({...r,data:i});continue}if(l&&typeof d!="string")throw new Error(`Invalid file ${E(r,o)}: url must be a string.`);e.push(r)}return e}async function pt(t,e){let n=await Nt(e);if(typeof t=="string")return n?{markdown:t,files:n}:{markdown:t};let o=await tt(t);if(o)return n?{card:o,files:n}:{card:o};throw new Error("Invalid message content \u2014 expected string or CardElement")}function Ut(t){return`${t}_${crypto.randomUUID()}`}function rt(t){if(t.markdown!==void 0)return{markdown:t.markdown};if(t.card!==void 0)return{card:t.card};throw new Error("Invalid reply content \u2014 expected markdown or card")}function ot(t){if(t!=null&&t.length)return t.map((e,n)=>({fileId:e.filename||`file_${n}`,name:e.filename,mediaType:e.mimeType,...e.data!==void 0?{data:typeof e.data=="string"?e.data:void 0}:{},...e.url!==void 0?{url:e.url}:{}}))}function U(t,e){e.toolApprovalRequest&&(t.toolApprovalRequest=e.toolApprovalRequest),e.signals.length&&(t.signals=e.signals),e.toolResults.length&&(t.toolResults=e.toolResults),e.addReactions.length&&(t.addReactions=e.addReactions),e.deleteMessages.length&&(t.deleteMessages=e.deleteMessages),e.resolve&&(t.resolve=e.resolve)}function F(t,e){var o;let n=[];if(t.toolApprovalRequest){let r=t.toolApprovalRequest;n.push({type:"tool-approval-request",approvalId:r.approvalId,toolUseId:r.toolCallId,toolName:r.name,input:r.input,...e!=null&&e.deliverApprovalCard?{deliverCard:!0}:{}})}for(let r of t.toolResults)n.push({type:"tool-use-result",toolUseId:r.toolCallId,content:[{type:"text",text:String((o=r.preview)!=null?o:"")},{type:"json",value:r.output}]});for(let r of t.signals)n.push({type:"signal",signal:r});for(let r of t.addReactions)n.push({type:"channel.reaction",messageId:r.messageId,emoji:r.emojiName,op:"add"});for(let r of t.deleteMessages)n.push({type:"channel.delete",messageId:r.messageId});return t.resolve&&n.push({type:"resolve",summary:t.resolve.summary}),n}var D=class{constructor(e,n,o,r){this.replyUrl=e;this.secretKey=n;this.conversationId=o;this.integrationIdentifier=r}async sendReply(e,n){let o=this._baseBody();return o.reply=e,U(o,n),this._post(o)}async sendApprovalCard(e,n){let o=this._baseBody();return o.reply={toolApprovalCard:e},U(o,n),this._post(o)}async editMessage(e,n){return this._post({...this._baseBody(),edit:{messageId:e,content:n}})}async deleteMessage(e){await this._post({...this._baseBody(),deleteMessages:[{messageId:e}]})}async setTyping(e){await this._post({...this._baseBody(),typing:e})}async flushSideEffects(e){let n=this._baseBody();U(n,e),await this._post(n)}async emitCustom(){}queueRunStart(){}async emitRunFinish(){}async reportTurnError(){await this._post({...this._baseBody(),error:!0})}_baseBody(){return{conversationId:this.conversationId,integrationIdentifier:this.integrationIdentifier}}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 r=await n.text().catch(()=>"");throw new f(n.status,r)}let o=await n.text().catch(()=>"");if(!o)return null;try{let r=JSON.parse(o),s=r&&typeof r=="object"&&"data"in r?r.data:r;if(s&&typeof s.messageId=="string"&&typeof s.platformThreadId=="string")return{messageId:s.messageId,platformThreadId:s.platformThreadId}}catch{}return null}},M=class{constructor(e){this.outbox=e}async sendReply(e,n){let o=Ut("msg"),r=F(n);return r.push({type:"message",role:"assistant",messageId:o,content:rt(e),files:ot(e.files)}),await this._emitAndFlush(r),{messageId:o,platformThreadId:""}}async sendApprovalCard(e,n){return await this._emitAndFlush(F(n,{deliverApprovalCard:!0})),"unaddressable"}async editMessage(e,n){return await this.outbox.emit({type:"channel.edit",messageId:e,content:rt(n),files:ot(n.files)}),{messageId:e,platformThreadId:""}}async deleteMessage(e){await this.outbox.emit({type:"channel.delete",messageId:e})}async setTyping(e){if(e==="stop"){await this.outbox.emit({type:"channel.typing",state:"off"});return}let n=typeof e=="object"&&"status"in e?e.status:void 0;await this.outbox.emit({type:"channel.typing",state:"on",status:n})}async flushSideEffects(e){await this._emitAndFlush(F(e))}async emitCustom(e,n){await this.outbox.emit({type:"custom",name:e,data:n})}queueRunStart(){this.outbox.enqueue({type:"run-start"})}async emitRunFinish(e){await this.outbox.emit({type:"run-finish",outcome:e})}async reportTurnError(e){await this.outbox.emit({type:"run-error",message:e!=null?e:"agent handler failed"})}async _emitAndFlush(e){if(e.length!==0){for(let n of e)this.outbox.enqueue(n);await this.outbox.flush()}}},T=class{constructor(e,n,o){this.transport=o;this.editedByHandler=!1;this.messageId=e,this.platformThreadId=n}async edit(e,n){this.editedByHandler=!0;let o=await pt(e,n==null?void 0:n.files),r=await this.transport.editMessage(this.messageId,o);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.transport.deleteMessage(this.messageId)}},$=class{constructor(){this.messageId="";this.platformThreadId=""}async edit(){return this}async delete(){}},at;at=de;var st=class{constructor(e,n,o){this[at]=!0;this._signals=[];this._toolResults=[];this._pendingToolApprovalRequest=null;this._pendingReactions=[];this._pendingDeletes=[];this._resolveSignal=null;var a,l,i,u;this.event=e.event,this.action=(a=e.action)!=null?a:null,this.message=e.message,this.reaction=e.reaction,this.conversation=e.conversation,this.subscriber=e.subscriber,this.context=(l=e.context)!=null?l:null,this.notification=(i=e.notification)!=null?i:null,this.history=e.history,this.platform=e.platform,this.platformContext=e.platformContext,this._toolApprovalConfig=o,this._transport=e.eventsUrl?new M(new b({eventsUrl:e.eventsUrl,secretKey:n,conversationId:e.conversationId,agentId:e.agentId,turnId:e.deliveryId})):new D(e.replyUrl,n,e.conversationId,e.integrationIdentifier),this._metadataState={...(u=e.conversation.metadata)!=null?u:{}};let r=this;this.metadata={get(p){return r._metadataState[p]},set(p,c){r._metadataState[p]=c,r._signals.push({type:"metadata",action:"set",key:p,value:c})},delete(p){delete r._metadataState[p],r._signals.push({type:"metadata",action:"delete",key:p})},clear(){r._metadataState={},r._signals.push({type:"metadata",action:"clear"})},get current(){return{...r._metadataState}}};let s=p=>this._transport.setTyping(p),d=(p=>s(p===void 0?{}:{status:p}));d.stop=()=>s("stop"),this.typing=d,this.toolApproval={request:async p=>(await ue(this,p,this._toolApprovalConfig),new I)}}asMessageContext(){return this}async reply(e,n){let o=await pt(e,n==null?void 0:n.files),r=this._drainSideEffectsSnapshot(),s=await this._transport.sendReply(o,r);if(!s)throw new Error("Agent reply did not return a message handle");return new T(s.messageId,s.platformThreadId,this._transport)}async replyApprovalCard(e){let n=this._drainSideEffectsSnapshot(),o=await this._transport.sendApprovalCard(e,n);if(o==="unaddressable")return new $;if(!o)throw new Error("Agent approval card reply did not return a message handle");return new T(o.messageId,o.platformThreadId,this._transport)}createReplyHandle(e){return new T(e,"",this._transport)}async emit(e){await this._transport.emitCustom(e.name,e.data)}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})}queueRunStart(){this._transport.queueRunStart()}async emitRunFinish(e){try{await this._transport.emitRunFinish(e.outcome)}catch(n){console.error("[agent] Failed to emit run finish:",n)}}async reportTurnError(e){try{await this._transport.reportTurnError(e)}catch(n){console.error("[agent] Failed to report turn error:",n)}}async flush(){if(!this._hasPendingSideEffects())return;let e=this._drainSideEffectsSnapshot();await this._transport.flushSideEffects(e)}_hasPendingSideEffects(){return!!(this._pendingToolApprovalRequest||this._signals.length||this._toolResults.length||this._resolveSignal||this._pendingReactions.length||this._pendingDeletes.length)}_drainSideEffectsSnapshot(){let e={toolApprovalRequest:this._pendingToolApprovalRequest,signals:this._signals,toolResults:this._toolResults,addReactions:this._pendingReactions,deleteMessages:this._pendingDeletes,resolve:this._resolveSignal};return this._pendingToolApprovalRequest=null,this._signals=[],this._toolResults=[],this._pendingReactions=[],this._pendingDeletes=[],this._resolveSignal=null,e}};var hr={type:"object",properties:{},required:[],additionalProperties:!1};var Ft=(i=>(i.PENDING="pending",i.QUEUED="queued",i.RUNNING="running",i.COMPLETED="completed",i.FAILED="failed",i.DELAYED="delayed",i.CANCELED="canceled",i.MERGED="merged",i.SKIPPED="skipped",i))(Ft||{});var Dt=(r=>(r.NONE="none",r.LOW="low",r.MEDIUM="medium",r.HIGH="high",r))(Dt||{});export{ce as a,me as b,fe as c,he as d,ye as e,Re as f,ve as g,Se as h,Ae as i,xe as j,Te as k,Wt as l,Ee as m,_e as n,Ce as o,we as p,v as q,h as r,S as s,Oe as t,Ie as u,Pe as v,ke as w,Ne as x,Ue as y,Fe as z,De as A,Me as B,$e as C,Le as D,Be as E,je as F,tt as G,ut as H,qe as I,He as J,Qe as K,qn as L,zn as M,A as N,f as O,Jn as P,vt as Q,I as R,Zn as S,st as T,hr as U,Ft as V,Dt as W};