@novu/framework 2.13.0 → 2.13.1-rc.72c80d5b17
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.
- package/dist/cjs/{agent.types-Dqm2VBTO.d.cts → agent.types-B5VnP69G.d.cts} +48 -2
- package/dist/cjs/ai-sdk/index.d.cts +1 -1
- package/dist/cjs/cards.cjs +1 -1
- package/dist/cjs/{health-check.types-B9FbzRbm.d.cts → health-check.types-CtWQ_YSy.d.cts} +4 -3
- package/dist/cjs/{index-CLZZRnNV.d.cts → index-vgb88C84.d.cts} +3 -3
- package/dist/cjs/index.cjs +88 -88
- package/dist/cjs/index.d.cts +5 -5
- package/dist/cjs/internal/index.cjs +43 -43
- package/dist/cjs/internal/index.d.cts +19 -15
- package/dist/cjs/langchain/index.cjs +1 -1
- package/dist/cjs/langchain/index.d.cts +15 -1
- package/dist/cjs/servers/express.cjs +88 -88
- package/dist/cjs/servers/express.d.cts +6 -6
- package/dist/cjs/servers/h3.cjs +86 -86
- package/dist/cjs/servers/h3.d.cts +6 -6
- package/dist/cjs/servers/hono.cjs +86 -86
- package/dist/cjs/servers/hono.d.cts +6 -6
- package/dist/cjs/servers/lambda.cjs +88 -88
- package/dist/cjs/servers/lambda.d.cts +6 -6
- package/dist/cjs/servers/nest.cjs +96 -96
- package/dist/cjs/servers/nest.d.cts +8 -8
- package/dist/cjs/servers/next.cjs +90 -90
- package/dist/cjs/servers/next.d.cts +6 -6
- package/dist/cjs/servers/nuxt.cjs +86 -86
- package/dist/cjs/servers/nuxt.d.cts +6 -6
- package/dist/cjs/servers/remix.cjs +86 -86
- package/dist/cjs/servers/remix.d.cts +6 -6
- package/dist/cjs/servers/sveltekit.cjs +74 -74
- package/dist/cjs/servers/sveltekit.d.cts +6 -6
- package/dist/cjs/step-resolver.cjs +4 -4
- package/dist/cjs/step-resolver.d.cts +17 -4
- package/dist/cjs/{subscriber.types-DubxcL8q.d.cts → subscriber.types-CyNKT0nZ.d.cts} +67 -2
- package/dist/cjs/validators.cjs +1 -1
- package/dist/esm/{agent.types-E3sxq6xr.d.ts → agent.types-HUDhyXrV.d.ts} +48 -2
- package/dist/esm/ai-sdk/index.d.ts +1 -1
- package/dist/esm/cards.js +1 -1
- package/dist/esm/{chunk-WDBIT4NK.js → chunk-CGZ5P44A.js} +66 -66
- package/dist/esm/chunk-FMKD6TON.js +1 -0
- package/dist/esm/{chunk-CANJPWLT.js → chunk-SPS3KBKF.js} +4 -4
- package/dist/esm/{chunk-FRWG7YTE.js → chunk-VY27ZAO7.js} +1 -1
- package/dist/esm/{chunk-46AHJTS7.js → chunk-X5AZIKIR.js} +8 -8
- package/dist/esm/{chunk-22DBAEUX.js → chunk-XIVU4VDS.js} +1 -1
- package/dist/esm/{chunk-2M25EATE.js → chunk-YLCLZVYS.js} +1 -1
- package/dist/esm/{health-check.types-BNocZ4Wk.d.ts → health-check.types-0Rv-l8yD.d.ts} +4 -3
- package/dist/esm/{index-CWldA6G5.d.ts → index-C0oUWDlb.d.ts} +3 -3
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/index.d.ts +10 -6
- package/dist/esm/internal/index.js +1 -1
- package/dist/esm/jsx-dev-runtime.js +1 -1
- package/dist/esm/{jsx-runtime-P2HN3TPO.js → jsx-runtime-5ZWEWA4A.js} +1 -1
- package/dist/esm/jsx-runtime.js +1 -1
- package/dist/esm/langchain/index.d.ts +15 -1
- package/dist/esm/langchain/index.js +1 -1
- package/dist/esm/servers/express.d.ts +6 -6
- package/dist/esm/servers/express.js +1 -1
- package/dist/esm/servers/h3.d.ts +6 -6
- package/dist/esm/servers/h3.js +1 -1
- package/dist/esm/servers/hono.d.ts +6 -6
- package/dist/esm/servers/hono.js +1 -1
- package/dist/esm/servers/lambda.d.ts +6 -6
- package/dist/esm/servers/lambda.js +1 -1
- package/dist/esm/servers/nest.d.ts +8 -8
- package/dist/esm/servers/nest.js +1 -1
- package/dist/esm/servers/next.d.ts +6 -6
- package/dist/esm/servers/next.js +1 -1
- package/dist/esm/servers/nuxt.d.ts +6 -6
- package/dist/esm/servers/nuxt.js +1 -1
- package/dist/esm/servers/remix.d.ts +6 -6
- package/dist/esm/servers/remix.js +1 -1
- package/dist/esm/servers/sveltekit.d.ts +6 -6
- package/dist/esm/servers/sveltekit.js +1 -1
- package/dist/esm/step-resolver.d.ts +17 -4
- package/dist/esm/step-resolver.js +1 -1
- package/dist/esm/{subscriber.types-CmybpXhA.d.ts → subscriber.types-g7VnI_ZQ.d.ts} +67 -2
- package/dist/esm/validators.js +1 -1
- package/langchain/package.json +4 -0
- package/nest/package.json +2 -1
- package/package.json +2 -2
- package/dist/esm/chunk-LHU5A7DI.js +0 -1
- /package/dist/esm/{chunk-3ZWME5KT.js → chunk-7C3QBYLB.js} +0 -0
- /package/dist/esm/{chunk-XEHQJMMQ.js → chunk-RBTQQ5IZ.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
3
|
-
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
5
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-C0oUWDlb.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
5
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-g7VnI_ZQ.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
|
|
7
7
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
8
|
-
export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
9
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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';
|
|
12
12
|
import 'json-schema-to-ts';
|
package/dist/esm/servers/hono.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as N,c as p,d as E,e as H}from"../chunk-
|
|
1
|
+
import{a as s,b as N,c as p,d as E,e as H}from"../chunk-CGZ5P44A.js";import{a as O}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as R,N as C,O as U,V as k}from"../chunk-FMKD6TON.js";import{a as m,b as h,c as l,d as c,e as f,f as x,p as w,q as y,r as q}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as S}from"../chunk-SPS3KBKF.js";import{f as v}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.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{}},F=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,C as AgentDeliveryError,R as AgentError,h as Button,l as Card,c as CardLink,f as CardText,N as Client,v as CronExpression,x as Divider,p as NovuRequestHandler,w as Select,y as SelectOption,k as SeverityLevelEnum,q as TextInput,E as agent,u as frameworkName,S as providerSchemas,F as serve,O as step,U as toAgentError,H as workflow};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as aws_lambda from 'aws-lambda';
|
|
2
2
|
import { APIGatewayProxyEventV2, APIGatewayProxyResult } from 'aws-lambda';
|
|
3
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
4
|
-
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-
|
|
5
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
6
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-C0oUWDlb.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
5
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
6
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-g7VnI_ZQ.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, Select, SelectOption, TextInput } from 'chat';
|
|
10
|
-
export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
11
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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';
|
|
14
14
|
import 'zod';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as E,c as n,d as S,e as g}from"../chunk-
|
|
1
|
+
import{b as E,c as n,d as S,e as g}from"../chunk-CGZ5P44A.js";import{a as V}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as I,N as A,O as G,V as q}from"../chunk-FMKD6TON.js";import{a as m,b as u,c as P,d as h,e as i,f as w,p as l,q as f,r as x}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as b}from"../chunk-SPS3KBKF.js";import{f as c}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var p="lambda",N=y=>new n({frameworkName:p,...y,handler:r=>{let s=(e=>e.version==="2.0")(r);return{url:()=>{let e=s?r.requestContext.http.path:r.path,t=r.headers["x-forwarded-proto"]||"https",a=new URL(e,`${t}://${r.headers.host||r.headers.Host||""}`);for(let o in r.queryStringParameters)o&&a.searchParams.set(o,r.queryStringParameters[o]);return a},body:()=>{let e="{}";return r.body&&(e=r.isBase64Encoded?Buffer.from(r.body,"base64").toString():r.body),JSON.parse(e)},headers:e=>r.headers[e],queryString:e=>{var t;return(t=r.queryStringParameters)==null?void 0:t[e]},transformResponse:({body:e,status:t,headers:a})=>Promise.resolve({body:e,statusCode:t,headers:a}),method:()=>s?r.requestContext.http.method:r.httpMethod}}}).createHandler();export{m as Actions,A as AgentDeliveryError,I as AgentError,u as Button,P as Card,h as CardLink,i as CardText,E as Client,c as CronExpression,w as Divider,n as NovuRequestHandler,l as Select,f as SelectOption,q as SeverityLevelEnum,x as TextInput,S as agent,p as frameworkName,b as providerSchemas,N as serve,V as step,G as toAgentError,g as workflow};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-
|
|
2
|
-
export { a as agent, w as workflow } from '../index-
|
|
3
|
-
import { W as Workflow } from '../health-check.types-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-
|
|
1
|
+
import { I as INovuRequestHandlerOptions, N as NovuRequestHandler, S as ServeHandlerOptions, C as Client } from '../index-C0oUWDlb.js';
|
|
2
|
+
export { a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
3
|
+
import { W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum } from '../health-check.types-0Rv-l8yD.js';
|
|
5
5
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
6
|
-
import { A as Agent } from '../agent.types-
|
|
7
|
-
export { a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
8
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.js';
|
|
9
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
6
|
+
import { A as Agent } from '../agent.types-HUDhyXrV.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 AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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-g7VnI_ZQ.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';
|
package/dist/esm/servers/nest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as J,c as P,d as Z,e as te}from"../chunk-
|
|
1
|
+
import{b as J,c as P,d as Z,e as te}from"../chunk-CGZ5P44A.js";import{a as oe}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as Q,N as W,O as X,V as re}from"../chunk-FMKD6TON.js";import{a as j,b as F,c as L,d as V,e as U,f as k,p as B,q as $,r as K}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as ee}from"../chunk-SPS3KBKF.js";import{f as z}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.js";import{d as n,e as i}from"../chunk-FHYMHX3T.js";import{Inject as N,Injectable as H}from"@nestjs/common";import{ConfigurableModuleBuilder as x}from"@nestjs/common";var{ConfigurableModuleClass:u,MODULE_OPTIONS_TOKEN:m,OPTIONS_TYPE:pe,ASYNC_OPTIONS_TYPE:ae}=new x().setClassMethodName("register").setFactoryMethodName("createNovuModuleOptions").setExtras(o=>({...o,isGlobal:!0})).build();var h="REGISTER_API_PATH",E="REGISTER_CONTROLLER_DECORATORS";import{Injectable as A}from"@nestjs/common";var c=class{handler(e,r){return{body:()=>e.body,headers:t=>{let a=e.headers[t.toLowerCase()];return Array.isArray(a)?a[0]:a},method:()=>e.method||"GET",queryString:t=>{let a=e.query[t];return Array.isArray(a)?a[0]:a},url:()=>{let t=e.headers.host||"",a=t!=null&&t.includes("://")?"":`${e.protocol||"https"}://`;return new URL(e.originalUrl||e.url||"",`${a}${t||""}`)},transformResponse:({body:t,headers:a,status:y})=>(Object.entries(a).forEach(([I,_])=>{r.setHeader(I,_)}),r.status(y).send(t))}}};c=n([A()],c);var q="nest",l=class{constructor(e,r){this.options=e;this.novuHandler=r;this.novuRequestHandler=new P({frameworkName:q,...this.options,handler:this.novuHandler.handler})}async handleRequest(e,r){await this.novuRequestHandler.createHandler()(e,r)}};l=n([H(),i(0,N(m)),i(1,N(c))],l);import{Controller as M,Get as D,Inject as C,Options as b,Post as w,Req as f,Res as O}from"@nestjs/common";var p=class{constructor(e){this.novuService=e}async handleGet(e,r){await this.novuService.handleRequest(e,r)}async handlePost(e,r){await this.novuService.handleRequest(e,r)}async handleOptions(e,r){await this.novuService.handleRequest(e,r)}};n([D(),i(0,f()),i(1,O())],p.prototype,"handleGet",1),n([w(),i(0,f()),i(1,O())],p.prototype,"handlePost",1),n([b(),i(0,f()),i(1,O())],p.prototype,"handleOptions",1),p=n([M(),i(0,C(l))],p);import{Module as G}from"@nestjs/common";import{PATH_METADATA as Y}from"@nestjs/common/constants";var R={provide:h,useFactory:o=>{if(!o.apiPath)throw new Error("`apiPath` must be provided to set the controller path");Reflect.defineMetadata(Y,o.apiPath,p)},inject:[m]};function T(o,e=[]){return e.reduce((r,s)=>{let t=s(r);return t!=null?t:r},o)}function g(o,e){var r;for(let s of(r=Reflect.getMetadataKeys(o))!=null?r:[])Reflect.defineMetadata(s,Reflect.getMetadata(s,o),e)}function S(o,e=[]){let r=T(o,e);r!==o&&g(r,o)}var v={provide:E,useFactory:o=>{var e;S(p,(e=o.controllerDecorators)!=null?e:[])},inject:[m]};var d=class extends u{static register(e,r){var t;let s=u.register(e);return s.controllers=[T(p,e.controllerDecorators||[])],(t=s.providers)==null||t.push(R,l,c,...r||[]),s.exports=[l,c],s}static registerAsync(e,r){var t;let s=u.registerAsync(e);return s.controllers=[p],(t=s.providers)==null||t.push(R,v,l,c,...r||[]),s.exports=[l,c],s}};d=n([G({})],d);export{j as Actions,W as AgentDeliveryError,Q as AgentError,F as Button,L as Card,V as CardLink,U as CardText,J as Client,z as CronExpression,k as Divider,m as NOVU_OPTIONS,l as NovuClient,p as NovuController,c as NovuHandler,d as NovuModule,P as NovuRequestHandler,h as REGISTER_API_PATH,E as REGISTER_CONTROLLER_DECORATORS,B as Select,$ as SelectOption,re as SeverityLevelEnum,K as TextInput,Z as agent,q as frameworkName,ee as providerSchemas,R as registerApiPath,v as registerControllerDecorators,oe as step,X as toAgentError,te as workflow};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
3
|
-
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
5
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-C0oUWDlb.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
5
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-g7VnI_ZQ.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
|
|
7
7
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
8
|
-
export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
9
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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';
|
|
12
12
|
import 'json-schema-to-ts';
|
package/dist/esm/servers/next.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as F,c as f,d as G,e as $}from"../chunk-
|
|
1
|
+
import{a as c,b as F,c as f,d as G,e as $}from"../chunk-CGZ5P44A.js";import{a as D}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as U,N as k,O as j,V as L}from"../chunk-FMKD6TON.js";import{a as S,b as q,c as w,d as P,e as T,f as v,p as A,q as E,r as b}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as I}from"../chunk-SPS3KBKF.js";import{f as g}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.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",_=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,k as AgentDeliveryError,U as AgentError,q as Button,w as Card,P as CardLink,T as CardText,F as Client,g as CronExpression,v as Divider,f as NovuRequestHandler,A as Select,E as SelectOption,L as SeverityLevelEnum,b as TextInput,G as agent,N as frameworkName,I as providerSchemas,_ as serve,D as step,j as toAgentError,$ as workflow};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { H3Event } from 'h3';
|
|
3
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
4
|
-
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-
|
|
5
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
6
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
3
|
+
import { S as ServeHandlerOptions } from '../index-C0oUWDlb.js';
|
|
4
|
+
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
5
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
6
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-g7VnI_ZQ.js';
|
|
7
7
|
import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
|
|
8
8
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
9
|
-
export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
10
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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';
|
|
13
13
|
import 'json-schema-to-ts';
|
package/dist/esm/servers/nuxt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x,c as t,d as b,e as $}from"../chunk-
|
|
1
|
+
import{b as x,c as t,d as b,e as $}from"../chunk-CGZ5P44A.js";import{a as B}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as E,N as k,O,V as F}from"../chunk-FMKD6TON.js";import{a as l,b as H,c as S,d as i,e as y,f,p as g,q as N,r as w}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as q}from"../chunk-SPS3KBKF.js";import{f as c}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";import{getHeader as o,getQuery as a,readBody as n,send as p,setHeaders as m}from"h3";var u="nuxt",Q=d=>new t({frameworkName:u,...d,handler:r=>({queryString:e=>String(a(r)[e]),body:()=>n(r),headers:e=>o(r,e),url:()=>new URL(String(r.path),`${process.env.NODE_ENV==="development"?"http":"https"}://${String(o(r,"host"))}`),method:()=>r.method,transformResponse:e=>{let{res:s}=r.node;return s.statusCode=e.status,m(r,e.headers),p(r,e.body)}})}).createHandler();export{l as Actions,k as AgentDeliveryError,E as AgentError,H as Button,S as Card,i as CardLink,y as CardText,x as Client,c as CronExpression,f as Divider,t as NovuRequestHandler,g as Select,N as SelectOption,F as SeverityLevelEnum,w as TextInput,b as agent,u as frameworkName,q as providerSchemas,Q as serve,B as step,O as toAgentError,$ as workflow};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
2
|
-
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-
|
|
3
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
4
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
1
|
+
import { S as ServeHandlerOptions } from '../index-C0oUWDlb.js';
|
|
2
|
+
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
3
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
4
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-g7VnI_ZQ.js';
|
|
5
5
|
import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
|
|
6
6
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
7
|
-
export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
8
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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';
|
|
11
11
|
import 'json-schema-to-ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as v,c as o,d as g,e as F}from"../chunk-
|
|
1
|
+
import{a as t,b as v,c as o,d as g,e as F}from"../chunk-CGZ5P44A.js";import{a as O}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as H,N,O as S,V as q}from"../chunk-FMKD6TON.js";import{a as u,b as h,c as l,d as R,e as c,f as i,p as w,q as f,r as x}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as y}from"../chunk-SPS3KBKF.js";import{f as k}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="remix",L=s=>new o({frameworkName:m,...s,handler:({request:e})=>({body:()=>e.json(),headers:r=>e.headers.get(r),method:()=>e.method,url:()=>new URL(e.url,`https://${e.headers.get("host")||""}`),transformResponse:({body:r,status:n,headers:p})=>{let a=t();return new a(r,{status:n,headers:p})}})}).createHandler();export{u as Actions,N as AgentDeliveryError,H as AgentError,h as Button,l as Card,R as CardLink,c as CardText,v as Client,k as CronExpression,i as Divider,o as NovuRequestHandler,w as Select,f as SelectOption,q as SeverityLevelEnum,x as TextInput,g as agent,m as frameworkName,y as providerSchemas,L as serve,O as step,S as toAgentError,F as workflow};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { RequestEvent } from '@sveltejs/kit';
|
|
2
|
-
import { S as ServeHandlerOptions } from '../index-
|
|
3
|
-
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-
|
|
4
|
-
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-
|
|
5
|
-
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-
|
|
2
|
+
import { S as ServeHandlerOptions } from '../index-C0oUWDlb.js';
|
|
3
|
+
export { C as Client, N as NovuRequestHandler, a as agent, w as workflow } from '../index-C0oUWDlb.js';
|
|
4
|
+
export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-0Rv-l8yD.js';
|
|
5
|
+
export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-g7VnI_ZQ.js';
|
|
6
6
|
import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js';
|
|
7
7
|
export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Select, SelectOption, TextInput } from 'chat';
|
|
8
|
-
export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as
|
|
9
|
-
export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, step } from '../step-resolver.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 AgentMessage, n as AgentMessageAuthor, o as AgentMessageContext, p as AgentPlatformContext, q as AgentReaction, r as AgentReactionContext, s as AgentResolveContext, t as AgentSubscriber, u as AgentSubscriberAccess, v as AgentToolCall, F as FileRef, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, w as ToolApprovalConfig, x as ToolApprovalDecision, y as toAgentError } from '../agent.types-HUDhyXrV.js';
|
|
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';
|
|
12
12
|
import 'json-schema-to-ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,b as q,c as s,d as y,e as k}from"../chunk-
|
|
1
|
+
import{a as r,b as q,c as s,d as y,e as k}from"../chunk-CGZ5P44A.js";import{a as H}from"../chunk-YLCLZVYS.js";import"../chunk-XIVU4VDS.js";import{M as F,N as b,O as w,V as I}from"../chunk-FMKD6TON.js";import{a as v,b as E,c as P,d as R,e as T,f as S,p as c,q as f,r as h}from"../chunk-X5AZIKIR.js";import"../chunk-RBTQQ5IZ.js";import{a as G}from"../chunk-SPS3KBKF.js";import{f as N}from"../chunk-VY27ZAO7.js";import"../chunk-W6DIBD4Z.js";import"../chunk-FHYMHX3T.js";var m="sveltekit",j=o=>{let t=new s({frameworkName:m,...o,handler:(u,e)=>({method:()=>u||e.request.method||"",body:()=>e.request.json(),headers:n=>e.request.headers.get(n),url:()=>{let n=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="dev"?"http":"https";return new URL(e.request.url,`${n}://${e.request.headers.get("host")||""}`)},transformResponse:({body:n,headers:d,status:a})=>{let l=r();return new l(n,{status:a,headers:d})}})}).createHandler(),p=t.bind(null,void 0);return Object.defineProperties(p,{GET:{value:t.bind(null,"GET")},POST:{value:t.bind(null,"POST")},OPTIONS:{value:t.bind(null,"OPTIONS")}})};export{v as Actions,b as AgentDeliveryError,F as AgentError,E as Button,P as Card,R as CardLink,T as CardText,q as Client,N as CronExpression,S as Divider,s as NovuRequestHandler,c as Select,f as SelectOption,I as SeverityLevelEnum,h as TextInput,y as agent,m as frameworkName,G as providerSchemas,j as serve,H as step,w as toAgentError,k as workflow};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Subscriber, C as ContextResolved, E as EnvironmentSystemVariables, G as EmailOutputUnvalidated, p as providerSchemas, W as WithPassthrough, R as SmsOutputUnvalidated, h as ChatOutputUnvalidated, M as PushOutputUnvalidated, J as InAppOutputUnvalidated, n as DelayOutputUnvalidated, v as DigestOutputUnvalidated, Y as ThrottleOutputUnvalidated } from './subscriber.types-
|
|
2
|
-
export {
|
|
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-g7VnI_ZQ.js';
|
|
2
|
+
export { a0 as actionStepSchemas, a1 as channelStepSchemas } from './subscriber.types-g7VnI_ZQ.js';
|
|
3
3
|
import { A as Awaitable } from './util.types-DaFfsxgy.js';
|
|
4
4
|
import { S as Schema, a as FromSchema } from './base.schema.types-BApIn9jr.js';
|
|
5
5
|
import 'json-schema-to-ts';
|
|
@@ -93,6 +93,17 @@ type InAppStepResolver<TControlSchema extends Schema | undefined = undefined, TP
|
|
|
93
93
|
providers?: StepResolverProviders<'in_app', ResolveControls<TControlSchema>, InAppOutputUnvalidated, ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>;
|
|
94
94
|
disableOutputSanitization?: boolean;
|
|
95
95
|
};
|
|
96
|
+
type ToolStepResolver<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined> = {
|
|
97
|
+
type: 'tool';
|
|
98
|
+
stepId: string;
|
|
99
|
+
resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<ToolOutputUnvalidated>;
|
|
100
|
+
controlSchema?: TControlSchema;
|
|
101
|
+
payloadSchema?: TPayloadSchema;
|
|
102
|
+
envSchema?: TEnvSchema;
|
|
103
|
+
skip?: BaseStepResolverOptions<TControlSchema, TPayloadSchema, TEnvSchema>['skip'];
|
|
104
|
+
providers?: StepResolverProviders<'tool', ResolveControls<TControlSchema>, ToolOutputUnvalidated, ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>;
|
|
105
|
+
disableOutputSanitization?: boolean;
|
|
106
|
+
};
|
|
96
107
|
type DelayStepResolver<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined> = {
|
|
97
108
|
type: 'delay';
|
|
98
109
|
stepId: string;
|
|
@@ -120,12 +131,13 @@ type ThrottleStepResolver<TControlSchema extends Schema | undefined = undefined,
|
|
|
120
131
|
envSchema?: TEnvSchema;
|
|
121
132
|
skip?: BaseStepResolverOptions<TControlSchema, TPayloadSchema, TEnvSchema>['skip'];
|
|
122
133
|
};
|
|
123
|
-
type AnyStepResolver = EmailStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | SmsStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | ChatStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | PushStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | InAppStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | DelayStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | DigestStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | ThrottleStepResolver<Schema | undefined, Schema | undefined, Schema | undefined>;
|
|
134
|
+
type AnyStepResolver = EmailStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | SmsStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | ChatStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | PushStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | InAppStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | ToolStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | DelayStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | DigestStepResolver<Schema | undefined, Schema | undefined, Schema | undefined> | ThrottleStepResolver<Schema | undefined, Schema | undefined, Schema | undefined>;
|
|
124
135
|
declare function email<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<EmailOutputUnvalidated>, options?: ChannelStepResolverOptions<'email', TControlSchema, TPayloadSchema, EmailOutputUnvalidated, TEnvSchema>): EmailStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
125
136
|
declare function sms<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<SmsOutputUnvalidated>, options?: ChannelStepResolverOptions<'sms', TControlSchema, TPayloadSchema, SmsOutputUnvalidated, TEnvSchema>): SmsStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
126
137
|
declare function chat<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<ChatOutputUnvalidated>, options?: ChannelStepResolverOptions<'chat', TControlSchema, TPayloadSchema, ChatOutputUnvalidated, TEnvSchema>): ChatStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
127
138
|
declare function push<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<PushOutputUnvalidated>, options?: ChannelStepResolverOptions<'push', TControlSchema, TPayloadSchema, PushOutputUnvalidated, TEnvSchema>): PushStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
128
139
|
declare function inApp<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<InAppOutputUnvalidated>, options?: ChannelStepResolverOptions<'in_app', TControlSchema, TPayloadSchema, InAppOutputUnvalidated, TEnvSchema>): InAppStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
140
|
+
declare function tool<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<ToolOutputUnvalidated>, options?: ChannelStepResolverOptions<'tool', TControlSchema, TPayloadSchema, ToolOutputUnvalidated, TEnvSchema>): ToolStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
129
141
|
declare function delay<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<DelayOutputUnvalidated>, options?: BaseStepResolverOptions<TControlSchema, TPayloadSchema, TEnvSchema>): DelayStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
130
142
|
declare function digest<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<DigestOutputUnvalidated>, options?: BaseStepResolverOptions<TControlSchema, TPayloadSchema, TEnvSchema>): DigestStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
131
143
|
declare function throttle<TControlSchema extends Schema | undefined = undefined, TPayloadSchema extends Schema | undefined = undefined, TEnvSchema extends Schema | undefined = undefined>(stepId: string, resolve: (controls: ResolveControls<TControlSchema>, ctx: StepResolverContext<ResolveControls<TPayloadSchema>, ResolveEnv<TEnvSchema>>) => Promise<ThrottleOutputUnvalidated>, options?: BaseStepResolverOptions<TControlSchema, TPayloadSchema, TEnvSchema>): ThrottleStepResolver<TControlSchema, TPayloadSchema, TEnvSchema>;
|
|
@@ -135,9 +147,10 @@ declare const step: {
|
|
|
135
147
|
chat: typeof chat;
|
|
136
148
|
push: typeof push;
|
|
137
149
|
inApp: typeof inApp;
|
|
150
|
+
tool: typeof tool;
|
|
138
151
|
delay: typeof delay;
|
|
139
152
|
digest: typeof digest;
|
|
140
153
|
throttle: typeof throttle;
|
|
141
154
|
};
|
|
142
155
|
|
|
143
|
-
export { type AnyStepResolver, type ChatStepResolver, ContextResolved, type DelayStepResolver, type DigestStepResolver, type EmailStepResolver, type InAppStepResolver, type PushStepResolver, type SmsStepResolver, type StepResolverContext, Subscriber, type ThrottleStepResolver, WithPassthrough, providerSchemas, step };
|
|
156
|
+
export { type AnyStepResolver, type ChatStepResolver, ContextResolved, type DelayStepResolver, type DigestStepResolver, type EmailStepResolver, type InAppStepResolver, type PushStepResolver, type SmsStepResolver, type StepResolverContext, Subscriber, type ThrottleStepResolver, type ToolStepResolver, WithPassthrough, providerSchemas, step };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-YLCLZVYS.js";import{a as e,e as t,f as r}from"./chunk-SPS3KBKF.js";import"./chunk-FHYMHX3T.js";export{t as actionStepSchemas,r as channelStepSchemas,e as providerSchemas,o as step};
|
|
@@ -103,7 +103,8 @@ declare enum ChannelStepEnum {
|
|
|
103
103
|
SMS = "sms",
|
|
104
104
|
PUSH = "push",
|
|
105
105
|
CHAT = "chat",
|
|
106
|
-
IN_APP = "in_app"
|
|
106
|
+
IN_APP = "in_app",
|
|
107
|
+
TOOL = "tool"
|
|
107
108
|
}
|
|
108
109
|
declare enum ActionStepEnum {
|
|
109
110
|
DIGEST = "digest",
|
|
@@ -654,6 +655,14 @@ declare const providerSchemas: {
|
|
|
654
655
|
readonly additionalProperties: true;
|
|
655
656
|
};
|
|
656
657
|
};
|
|
658
|
+
readonly 'ruach-sms': {
|
|
659
|
+
output: {
|
|
660
|
+
readonly type: "object";
|
|
661
|
+
readonly properties: {};
|
|
662
|
+
readonly required: readonly [];
|
|
663
|
+
readonly additionalProperties: true;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
657
666
|
};
|
|
658
667
|
readonly email: {
|
|
659
668
|
readonly anypost: {
|
|
@@ -3679,6 +3688,32 @@ declare const providerSchemas: {
|
|
|
3679
3688
|
};
|
|
3680
3689
|
};
|
|
3681
3690
|
};
|
|
3691
|
+
readonly tool: {
|
|
3692
|
+
readonly pagerduty: {
|
|
3693
|
+
output: {
|
|
3694
|
+
readonly type: "object";
|
|
3695
|
+
readonly properties: {};
|
|
3696
|
+
readonly required: readonly [];
|
|
3697
|
+
readonly additionalProperties: true;
|
|
3698
|
+
};
|
|
3699
|
+
};
|
|
3700
|
+
readonly opsgenie: {
|
|
3701
|
+
output: {
|
|
3702
|
+
readonly type: "object";
|
|
3703
|
+
readonly properties: {};
|
|
3704
|
+
readonly required: readonly [];
|
|
3705
|
+
readonly additionalProperties: true;
|
|
3706
|
+
};
|
|
3707
|
+
};
|
|
3708
|
+
readonly 'tool-webhook': {
|
|
3709
|
+
output: {
|
|
3710
|
+
readonly type: "object";
|
|
3711
|
+
readonly properties: {};
|
|
3712
|
+
readonly required: readonly [];
|
|
3713
|
+
readonly additionalProperties: true;
|
|
3714
|
+
};
|
|
3715
|
+
};
|
|
3716
|
+
};
|
|
3682
3717
|
};
|
|
3683
3718
|
|
|
3684
3719
|
type Passthrough = {
|
|
@@ -4298,6 +4333,31 @@ declare const channelStepSchemas: {
|
|
|
4298
4333
|
readonly additionalProperties: false;
|
|
4299
4334
|
};
|
|
4300
4335
|
};
|
|
4336
|
+
readonly tool: {
|
|
4337
|
+
output: {
|
|
4338
|
+
readonly type: "object";
|
|
4339
|
+
readonly properties: {
|
|
4340
|
+
readonly body: {
|
|
4341
|
+
readonly type: "string";
|
|
4342
|
+
};
|
|
4343
|
+
readonly providerOverrides: {
|
|
4344
|
+
readonly type: "object";
|
|
4345
|
+
readonly additionalProperties: {
|
|
4346
|
+
readonly type: "object";
|
|
4347
|
+
readonly additionalProperties: true;
|
|
4348
|
+
};
|
|
4349
|
+
};
|
|
4350
|
+
};
|
|
4351
|
+
readonly required: readonly ["body"];
|
|
4352
|
+
readonly additionalProperties: false;
|
|
4353
|
+
};
|
|
4354
|
+
result: {
|
|
4355
|
+
readonly type: "object";
|
|
4356
|
+
readonly properties: {};
|
|
4357
|
+
readonly required: readonly [];
|
|
4358
|
+
readonly additionalProperties: false;
|
|
4359
|
+
};
|
|
4360
|
+
};
|
|
4301
4361
|
};
|
|
4302
4362
|
|
|
4303
4363
|
type Skip<T> = (controls: T) => Awaitable<boolean>;
|
|
@@ -4464,6 +4524,9 @@ type ChatResult = FromSchema<(typeof channelStepSchemas)['chat']['result']>;
|
|
|
4464
4524
|
type InAppOutput = FromSchema<(typeof channelStepSchemas)['in_app']['output']>;
|
|
4465
4525
|
type InAppOutputUnvalidated = FromSchemaUnvalidated<(typeof channelStepSchemas)['in_app']['output']>;
|
|
4466
4526
|
type InAppResult = FromSchema<(typeof channelStepSchemas)['in_app']['result']>;
|
|
4527
|
+
type ToolOutput = FromSchema<(typeof channelStepSchemas)['tool']['output']>;
|
|
4528
|
+
type ToolOutputUnvalidated = FromSchemaUnvalidated<(typeof channelStepSchemas)['tool']['output']>;
|
|
4529
|
+
type ToolResult = FromSchema<(typeof channelStepSchemas)['tool']['result']>;
|
|
4467
4530
|
type DelayRegularOutput = FromSchema<typeof delayRegularOutputSchema>;
|
|
4468
4531
|
type DelayRegularOutputUnvalidated = FromSchemaUnvalidated<typeof delayRegularOutputSchema>;
|
|
4469
4532
|
type DelayTimedOutput = FromSchema<typeof delayTimedOutputSchema>;
|
|
@@ -4497,6 +4560,8 @@ type Step = {
|
|
|
4497
4560
|
chat: ChannelStep<ChannelStepEnum.CHAT, ChatOutputUnvalidated, ChatResult>;
|
|
4498
4561
|
/** Send an in-app notification. */
|
|
4499
4562
|
inApp: ChannelStep<ChannelStepEnum.IN_APP, InAppOutputUnvalidated, InAppResult>;
|
|
4563
|
+
/** Deliver a tool payload to an external system (e.g. PagerDuty, Opsgenie, webhook). */
|
|
4564
|
+
tool: ChannelStep<ChannelStepEnum.TOOL, ToolOutputUnvalidated, ToolResult>;
|
|
4500
4565
|
/** Aggregate events for a period of time. */
|
|
4501
4566
|
digest: ActionStep<DigestOutputUnvalidated, DigestResult>;
|
|
4502
4567
|
/** Delay the workflow for a period of time. */
|
|
@@ -4529,4 +4594,4 @@ type Subscriber = {
|
|
|
4529
4594
|
data?: Record<string, unknown> | null;
|
|
4530
4595
|
};
|
|
4531
4596
|
|
|
4532
|
-
export {
|
|
4597
|
+
export { type ToolOutputUnvalidated as $, ActionStepEnum as A, type DigestTimedOutputUnvalidated as B, type ContextResolved as C, type DelayDynamicOutput as D, type EnvironmentSystemVariables as E, type EmailOutput as F, type EmailOutputUnvalidated as G, type EmailResult as H, type InAppOutput as I, type InAppOutputUnvalidated as J, type InAppResult as K, JobStatusEnum as L, type PushOutputUnvalidated as M, type PushResult as N, type Skip as O, type PushOutput as P, type SmsOutput as Q, type SmsOutputUnvalidated as R, type Subscriber as S, type SmsResult as T, type StepContext as U, type StepOutput as V, type WithPassthrough as W, type ThrottleOutput as X, type ThrottleOutputUnvalidated as Y, type ThrottleResult as Z, type ToolOutput as _, type ContextPayload as a, actionStepSchemas as a0, channelStepSchemas as a1, type Step as b, ChannelStepEnum as c, type StepOptions as d, type ActionStep as e, type ChannelStep as f, type ChatOutput as g, type ChatOutputUnvalidated as h, type ChatResult as i, type ContextValue as j, type CustomStep as k, type DelayDynamicOutputUnvalidated as l, type DelayOutput as m, type DelayOutputUnvalidated as n, type DelayRegularOutput as o, providerSchemas as p, type DelayRegularOutputUnvalidated as q, type DelayResult as r, type DelayTimedOutput as s, type DelayTimedOutputUnvalidated as t, type DigestOutput as u, type DigestOutputUnvalidated as v, type DigestRegularOutput as w, type DigestRegularOutputUnvalidated as x, type DigestResult as y, type DigestTimedOutput as z };
|
package/dist/esm/validators.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-XIVU4VDS.js";import"./chunk-VY27ZAO7.js";import"./chunk-FHYMHX3T.js";export{b as transformSchema,a as validateData};
|
package/nest/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novu/framework",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.1-rc.72c80d5b17",
|
|
4
4
|
"description": "The Code-First Notifications Workflow SDK.",
|
|
5
5
|
"main": "./dist/cjs/index.cjs",
|
|
6
6
|
"types": "./dist/cjs/index.d.cts",
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
"ajv-formats": "^2.1.1",
|
|
329
329
|
"better-ajv-errors": "^1.2.0",
|
|
330
330
|
"chalk": "^4.1.2",
|
|
331
|
-
"chat": "4.
|
|
331
|
+
"chat": "4.33.0",
|
|
332
332
|
"cross-fetch": "^4.0.0",
|
|
333
333
|
"json-schema-to-ts": "^3.0.0",
|
|
334
334
|
"jsonrepair": "^3.13.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as U,b as D,c as F,d as M,e as $,f as L,g as H,h as B,i as j,j as W,k as V,l as q,m as G,n as X,o as K,p as z,q as Y,r as J}from"./chunk-46AHJTS7.js";import{d as Q,g,i as Z,q as ee,r as te,s as c,t as y,u as T,v as ne}from"./chunk-FRWG7YTE.js";import{a as re,c as oe,f as se}from"./chunk-W6DIBD4Z.js";var ie=class extends T{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var le=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${r}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:r}}},pe=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=r}},de=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=r}},ce=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=o}},ue=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=o}},ge=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=o}},me=class extends c{constructor(n,r,o){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${r}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=o}},fe=class extends c{constructor(n,r,o,i){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${r}\` and provider with id: \`${o}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=i}},ye=class extends c{constructor(n,r){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=r}};var he=e=>Object.values(g).includes(e==null?void 0:e.code),bt=e=>!he(e)&&typeof e.statusCode=="number"&&e.statusCode>=400&&e.statusCode<500;var k=e=>Object.values(e).map(t=>`\`${t}\``).join(", "),E=e=>e.replaceAll(/(\w)(\w*)/g,(t,n,r)=>n.toUpperCase()+r.toLowerCase()).replaceAll(/[\s-]+/g,"");var Re=class extends ee{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${k(Z)}`}},Ae=class extends c{constructor(n,r){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${k(r)}`);this.code="InvalidActionError"}},Se=class extends c{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var xe=class extends Error{constructor(t,n,r){super(),this.data={message:r},this.statusCode=t,this.code=n}};var h=class extends ne{constructor(t,n){super(`${E(t)} with id: \`${n}\` already exists. Please use a different id.`)}},m=class extends te{constructor(t,n){super(`${E(t)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},R=class extends T{constructor(n,r,o,i){super(`Failed to ${o} ${E(n)} with id: \`${r}\``,{cause:i});this.statusCode=502}};var _e=class extends m{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},ve=class extends R{constructor(n,r,o){super("provider",n,r,o);this.code="ProviderExecutionFailedError"}};var Ee=class extends y{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"}},Ce=class extends y{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},we=class extends y{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},Oe=class extends y{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},Ie=class extends y{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}},be=class extends y{constructor(){super("Signature version is invalid. Please provide a signature version with version `v1` in the `novu-signature` header");this.code="SignatureVersionInvalidError"}};var ke=class extends m{constructor(n){super("step",n);this.code="StepNotFoundError"}},Pe=class extends h{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},Ne=class extends R{constructor(n,r,o){super("step",n,r,o);this.code="StepExecutionFailedError"}};var Ue=class extends m{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}},De=class extends h{constructor(n){super("workflow",n);this.code="WorkflowAlreadyExistsError"}};function nt(e,t){let n={...e};for(let r of Object.keys(t)){let o=t[r];o&&typeof o=="object"&&!Array.isArray(o)?n[r]=nt(n[r]||{},o):(Array.isArray(o),n[r]=o)}return n}function C(e,t){let n=t.split(".").reduce((r,o)=>{if(r&&typeof r=="object")return r[o]},e);if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"){let r=JSON.stringify(n);return r==="{}"?"":r}return""}function Fe(e,t=2,n,r=", "){if(!Array.isArray(e)||e.length===0)return"";let o=n?e.map(a=>typeof a!="object"||!a?"":C(a,n)):e;if(o.length===1)return o[0];if(o.length===2)return`${o[0]} and ${o[1]}`;if(o.length===3&&t>=3)return`${o[0]}${r}${o[1]} and ${o[2]}`;let i=o.slice(0,t),p=o.length-t;return`${i.join(r)} and ${p} ${p===1?"other":"others"}`}import rt from"pluralize";function Me(e,t="",n="",r="true"){if(e==null)return"";let o=0;if(Array.isArray(e)?o=e.length:typeof e=="object"?o=Object.keys(e).length:typeof e=="string"?o=+e:typeof e=="number"?o=e:o=Number(e),Number.isNaN(o)&&(o=0),o<=0)return"";let i;return n?i=o===1?t:n:i=rt(t,o),r==="true"?`${o} ${i}`:i}import{TokenKind as $e}from"liquidjs";import ot from"pluralize";import{z as f}from"zod";var He="",Be=2,je="other",We=", ",Ve=" and ",qe=", and ",Le={0:"keyPath",1:"limit",2:"overflowSuffix",3:"wordsConnector",4:"twoWordsConnector",5:"lastWordConnector"};function Ge(e,t=He,n=Be,r=je,o=We,i=Ve,p=qe){if(!Array.isArray(e)||e.length===0)return"";let a=t?e.map(u=>typeof u!="object"||!u?"":C(u,t)):e,l=a.length;if(l===1)return a[0];if(l===2)return`${a[0]}${i}${a[1]}`;if(n>=l){let u=a.slice(0,l-1),N=a[l-1];return`${u.join(o)}${p}${N}`}let s=a.slice(0,n),d=l-n,v=n===1?i:p;return`${s.join(o)}${v}${d} ${ot(r,d)}`}function On(e={},...t){let{requireKeyPath:n=!1}=e,r=[];if(t.length<1)return r.push({message:"Expected at least 1 argument",begin:0,end:0,value:""}),r;let o=f.object({keyPath:n?f.string().min(1,"must be non-empty"):f.string().optional().default(He),limit:f.number().optional().default(Be).refine(a=>a>=0,"must be greater than or equal to 0"),overflowSuffix:f.string().optional().default(je),wordsConnector:f.string().optional().default(We),twoWordsConnector:f.string().optional().default(Ve),lastWordConnector:f.string().optional().default(qe)}),i={};t.forEach((a,l)=>{if(!Array.isArray(a)){let s=a.getText();(a.kind===$e.Quoted||a.kind===$e.Number)&&(s=a.content);let d=Le[l];i[d]=s}});let p=o.safeParse(i);if(!p.success)for(let a of p.error.issues){let l="string";"type"in a&&(l=a.type);let s=a.path[0],d=Object.entries(Le).find(([N,tt])=>tt===s),v=d?parseInt(d[0],10):null,u=typeof v=="number"?t[v]:null;u&&!Array.isArray(u)&&r.push({message:`"toSentence" expects a ${l}${a.message?` that ${a.message}`:""} for argument "${s}"`,begin:u.begin,end:u.end,value:u.getText()})}return r}import{Liquid as st}from"liquidjs";function it(e){return Array.isArray(e)||typeof e=="object"&&e!==null?Xe(e):typeof e=="string"?e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):e==null?"":String(e)}var Xe=(e,t=0)=>Array.isArray(e)||typeof e=="object"&&e!==null?JSON.stringify(e,null,t).replace(/"/g,"'").replace(/\n/g,"\\n"):e==null?"":String(e);function Dn(e){let t=new st({outputEscape:it,...e});return t.registerFilter("json",(n,r)=>Xe(n,r)),t.registerFilter("digest",Fe),t.registerFilter("toSentence",Ge),t.registerFilter("pluralize",Me),t}var at={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 w(e){return typeof e=="string"&&e.trim()?e:!e||typeof e!="object"?null:w(e.message)}function lt(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t,r=w(n.message);if(r)return r;let o=w(n.error);if(o)return o;let i=n.errors;return Array.isArray(i)?w(i[0]):null}function pt(e,t){var o;let n=(o=at[e])!=null?o:e,r=lt(t);return r?`Delivery failed: ${n}: ${r}`:`Delivery failed: ${n}`}var A=class extends Error{constructor(t,n){super(t),this.name="AgentError",this.cause=n==null?void 0:n.cause,this.delivery=n==null?void 0:n.delivery}},O=class extends A{constructor(t,n){let r={statusCode:t,responseBody:n};super(pt(t,n),{delivery:r}),this.name="AgentDeliveryError",this.statusCode=t,this.responseBody=n}};function Mn(e){return e instanceof A?e:e instanceof Error?new A(e.message,{cause:e}):new A("Turn failed",{cause:e})}var dt=(o=>(o.ON_MESSAGE="onMessage",o.ON_ACTION="onAction",o.ON_RESOLVE="onResolve",o.ON_REACTION="onReaction",o))(dt||{}),I=class{constructor(){this.__novuPendingApproval=!0}};function Ln(e){return typeof e=="object"&&e!==null&&"suppress"in e&&e.suppress===!0}var ct=Symbol.for("chat.jsx.element"),ut=new Set([U,D,F,M,$,L,G,H,B,j,W,X,K,V,z,Y,q,J]);function gt(e){return typeof e=="object"&&e!==null&&e.$$typeof===ct}async function Ke(e){let t=b(e);if(t&&typeof t=="object"&&oe(t))return t;let{isJSX:n,toCardElement:r}=await import("./jsx-runtime-P2HN3TPO.js");return n(t)?r(t):null}function b(e){var t;if(Array.isArray(e))return e.map(n=>b(n));if(!gt(e))return e;if(typeof e.type=="function"&&!ut.has(e.type)){let n={...(t=e.props)!=null?t:{}};return e.children!==void 0&&(n.children=e.children),b(e.type(n))}return{...e,children:b(e.children)}}var mt=5*1024*1024,ft=5*1024*1024,ze=32768,yt=/^[A-Za-z0-9+/]*={0,2}$/;function _(e,t){return e.filename?`"${e.filename}"`:`at index ${t}`}function Qe(){return globalThis.Buffer}function ht(e){var t,n,r;return(r=(n=(t=Qe())==null?void 0:t.isBuffer)==null?void 0:n.call(t,e))!=null?r:!1}function Rt(e){return typeof Blob!="undefined"&&e instanceof Blob}function P(e){let t=Qe();if(t)return t.from(e).toString("base64");if(typeof btoa!="function")throw new Error("Unable to encode file data: base64 encoding is not available in this runtime.");let n="";for(let r=0;r<e.length;r+=ze){let o=e.subarray(r,r+ze);n+=String.fromCharCode(...o)}return btoa(n)}function Ze(e){let t=e.replace(/\s/g,""),n=t.length%4;if(!t||n===1||!yt.test(t))return null;let r=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.floor(t.length*3/4)-r}function S(e,t,n){if(e>mt)throw new Error(`Invalid file ${_(t,n)}: inline data must be 5 MB or smaller. Use a publicly-accessible URL for larger files.`)}async function At(e,t,n){if(typeof e=="string"){let r=Ze(e);if(r===null)throw new Error(`Invalid file ${_(t,n)}: data must be a base64-encoded string.`);return S(r,t,n),e}if(ht(e))return S(e.byteLength,t,n),e.toString("base64");if(e instanceof Uint8Array)return S(e.byteLength,t,n),P(e);if(e instanceof ArrayBuffer)return S(e.byteLength,t,n),P(new Uint8Array(e));if(Rt(e))return S(e.size,t,n),P(new Uint8Array(await e.arrayBuffer()));throw new Error(`Invalid file ${_(t,n)}: data must be a base64 string, Buffer, Uint8Array, ArrayBuffer, or Blob.`)}async function St(e){if(!(e!=null&&e.length))return;let t=[],n=0;for(let[r,o]of e.entries()){let i=o.data,p=o.url,a=i!=null,l=p!=null;if(a===l)throw new Error(`Invalid file ${_(o,r)}: provide exactly one of data or url.`);if(a){let s=await At(i,o,r),d=Ze(s);if(n+=d!=null?d:0,n>ft)throw new Error("Invalid files: total inline data must be 5 MB or smaller. Use publicly-accessible URLs for larger files.");t.push({...o,data:s});continue}if(l&&typeof p!="string")throw new Error(`Invalid file ${_(o,r)}: url must be a string.`);t.push(o)}return t}async function et(e,t){let n=await St(t);if(typeof e=="string")return n?{markdown:e,files:n}:{markdown:e};let r=await Ke(e);if(r)return n?{card:r,files:n}:{card:r};throw new Error("Invalid message content \u2014 expected string or CardElement")}var x=class{constructor(t,n,r,o,i){this.conversationId=r;this.integrationIdentifier=o;this.poster=i;this.editedByHandler=!1;this.messageId=t,this.platformThreadId=n}async edit(t,n){this.editedByHandler=!0;let r=await this.poster.post({conversationId:this.conversationId,integrationIdentifier:this.integrationIdentifier,edit:{messageId:this.messageId,content:await et(t,n==null?void 0:n.files)}});if(!r)throw new Error("Agent edit did not return a message handle");return this.messageId=r.messageId,this.platformThreadId=r.platformThreadId,this}async delete(){await this.poster.post({conversationId:this.conversationId,integrationIdentifier:this.integrationIdentifier,deleteMessages:[{messageId:this.messageId}]})}},Je;Je=re;var Ye=class{constructor(t,n,r){this[Je]=!0;this._signals=[];this._toolResults=[];this._pendingToolApprovalRequest=null;this._pendingReactions=[];this._pendingDeletes=[];this._resolveSignal=null;var a,l;this.event=t.event,this.action=(a=t.action)!=null?a:null,this.message=t.message,this.reaction=t.reaction,this.conversation=t.conversation,this.subscriber=t.subscriber,this.history=t.history,this.platform=t.platform,this.platformContext=t.platformContext,this._replyUrl=t.replyUrl,this._conversationId=t.conversationId,this._integrationIdentifier=t.integrationIdentifier,this._secretKey=n,this._poster={post:s=>this._post(s)},this._toolApprovalConfig=r,this._metadataState={...(l=t.conversation.metadata)!=null?l:{}};let o=this;this.metadata={get(s){return o._metadataState[s]},set(s,d){o._metadataState[s]=d,o._signals.push({type:"metadata",action:"set",key:s,value:d})},delete(s){delete o._metadataState[s],o._signals.push({type:"metadata",action:"delete",key:s})},clear(){o._metadataState={},o._signals.push({type:"metadata",action:"clear"})},get current(){return{...o._metadataState}}};let i=s=>this._post({conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,typing:s}).then(()=>{}),p=(s=>i(s===void 0?{}:{status:s}));p.stop=()=>i("stop"),this.typing=p,this.toolApproval={request:async s=>(await se(this,s,this._toolApprovalConfig),new I)}}asMessageContext(){return this}async reply(t,n){let r=await et(t,n==null?void 0:n.files),o={conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,reply:r};this._drainSideEffects(o);let i=await this._post(o);if(!i)throw new Error("Agent reply did not return a message handle");return new x(i.messageId,i.platformThreadId,this._conversationId,this._integrationIdentifier,this._poster)}async replyApprovalCard(t){let n={conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,reply:{toolApprovalCard:t}};this._drainSideEffects(n);let r=await this._post(n);if(!r)throw new Error("Agent approval card reply did not return a message handle");return new x(r.messageId,r.platformThreadId,this._conversationId,this._integrationIdentifier,this._poster)}createReplyHandle(t){return new x(t,"",this._conversationId,this._integrationIdentifier,this._poster)}resolve(t){this._resolveSignal={summary:t}}trigger(t,n){this._signals.push({...n,type:"trigger",workflowId:t})}emitToolApprovalRequest(t){if(this._pendingToolApprovalRequest)throw new Error("Only one tool approval request can be queued before the next reply");this._pendingToolApprovalRequest=t}emitToolResult(t){this._toolResults.push(t)}addReaction(t,n){this._pendingReactions.push({messageId:t,emojiName:n})}deleteMessage(t){this._pendingDeletes.push({messageId:t})}async reportTurnError(){try{await this._post({conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier,error:!0})}catch(t){console.error("[agent] Failed to report turn error:",t)}}async flush(){if(!this._hasPendingSideEffects())return;let t={conversationId:this._conversationId,integrationIdentifier:this._integrationIdentifier};this._drainSideEffects(t),await this._post(t)}_hasPendingSideEffects(){return!!(this._pendingToolApprovalRequest||this._signals.length||this._toolResults.length||this._resolveSignal||this._pendingReactions.length||this._pendingDeletes.length)}_drainSideEffects(t){this._pendingToolApprovalRequest&&(t.toolApprovalRequest=this._pendingToolApprovalRequest,this._pendingToolApprovalRequest=null),this._signals.length&&(t.signals=this._signals,this._signals=[]),this._toolResults.length&&(t.toolResults=this._toolResults,this._toolResults=[]),this._pendingReactions.length&&(t.addReactions=this._pendingReactions,this._pendingReactions=[]),this._pendingDeletes.length&&(t.deleteMessages=this._pendingDeletes,this._pendingDeletes=[]),this._resolveSignal&&(t.resolve=this._resolveSignal,this._resolveSignal=null)}async _post(t){let n=await fetch(this._replyUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${this._secretKey}`},body:JSON.stringify(t)});if(!n.ok){let o=await n.text().catch(()=>"");throw new O(n.status,o)}let r=await n.text().catch(()=>"");if(!r)return null;try{let o=JSON.parse(r),i=o&&typeof o=="object"&&"data"in o?o.data:o;if(i&&typeof i.messageId=="string"&&typeof i.platformThreadId=="string")return{messageId:i.messageId,platformThreadId:i.platformThreadId}}catch{}return null}};var Jn={type:"object",properties:{},required:[],additionalProperties:!1};var xt=(s=>(s.PENDING="pending",s.QUEUED="queued",s.RUNNING="running",s.COMPLETED="completed",s.FAILED="failed",s.DELAYED="delayed",s.CANCELED="canceled",s.MERGED="merged",s.SKIPPED="skipped",s))(xt||{});var _t=(o=>(o.NONE="none",o.LOW="low",o.MEDIUM="medium",o.HIGH="high",o))(_t||{});export{ie as a,le as b,pe as c,de as d,ce as e,ue as f,ge as g,me as h,fe as i,ye as j,he as k,bt as l,Re as m,Ae as n,Se as o,xe as p,h as q,m as r,R as s,_e as t,ve as u,Ee as v,Ce as w,we as x,Oe as y,Ie as z,be as A,ke as B,Pe as C,Ne as D,Ue as E,De as F,nt as G,Fe as H,Me as I,Ge as J,On as K,Dn as L,A as M,O as N,Mn as O,dt as P,I as Q,Ln as R,Ye as S,Jn as T,xt as U,_t as V};
|
|
File without changes
|
|
File without changes
|