import { P as PostActionEnum } from '../health-check.types-DORn4djx.js'; 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'; 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'; import { Filter, LiquidOptions, Liquid } from 'liquidjs'; import { Emoji } from 'chat'; 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'; 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'; 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'; export { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js'; 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'; export { a as ValidateFunction, V as ValidateResult, b as ValidationError, c as Validator } from '../validator.types-BIQli_m1.js'; import 'json-schema-to-ts'; import 'zod'; import 'ajv'; declare enum NovuApiEndpointsEnum { SYNC = "/v1/bridge/sync", DIFF = "/v1/bridge/diff" } declare const SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES = 5; declare const SIGNATURE_TIMESTAMP_TOLERANCE: number; declare enum ErrorCodeEnum { BRIDGE_ERROR = "BridgeError", EXECUTION_EVENT_CONTROL_INVALID_ERROR = "ExecutionEventControlInvalidError", EXECUTION_EVENT_PAYLOAD_INVALID_ERROR = "ExecutionEventPayloadInvalidError", EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR = "ExecutionProviderOutputInvalidError", EXECUTION_STATE_CONTROL_INVALID_ERROR = "ExecutionStateControlInvalidError", EXECUTION_STATE_CORRUPT_ERROR = "ExecutionStateCorruptError", EXECUTION_STATE_OUTPUT_INVALID_ERROR = "ExecutionStateOutputInvalidError", EXECUTION_STATE_RESULT_INVALID_ERROR = "ExecutionStateResultInvalidError", INVALID_ACTION_ERROR = "InvalidActionError", METHOD_NOT_ALLOWED_ERROR = "MethodNotAllowedError", MISSING_DEPENDENCY_ERROR = "MissingDependencyError", MISSING_SECRET_KEY_ERROR = "MissingSecretKeyError", PROVIDER_EXECUTION_FAILED_ERROR = "ProviderExecutionFailedError", PROVIDER_NOT_FOUND_ERROR = "ProviderNotFoundError", SIGNATURE_EXPIRED_ERROR = "SignatureExpiredError", SIGNATURE_INVALID_ERROR = "SignatureInvalidError", SIGNATURE_MISMATCH_ERROR = "SignatureMismatchError", SIGNATURE_NOT_FOUND_ERROR = "SignatureNotFoundError", SIGNATURE_VERSION_INVALID_ERROR = "SignatureVersionInvalidError", SIGNING_KEY_NOT_FOUND_ERROR = "SigningKeyNotFoundError", STEP_ALREADY_EXISTS_ERROR = "StepAlreadyExistsError", STEP_CONTROL_COMPILATION_FAILED_ERROR = "StepControlCompilationFailedError", STEP_EXECUTION_FAILED_ERROR = "StepExecutionFailedError", STEP_NOT_FOUND_ERROR = "StepNotFoundError", WORKFLOW_ALREADY_EXISTS_ERROR = "WorkflowAlreadyExistsError", WORKFLOW_NOT_FOUND_ERROR = "WorkflowNotFoundError", WORKFLOW_PAYLOAD_INVALID_ERROR = "WorkflowPayloadInvalidError" } declare enum HttpHeaderKeysEnum { NOVU_SIGNATURE = "novu-signature", NOVU_ANONYMOUS = "novu-anonymous", NOVU_FRAMEWORK_SDK = "novu-framework-sdk", NOVU_FRAMEWORK_SERVER = "novu-framework-server", NOVU_FRAMEWORK_VERSION = "novu-framework-version", USER_AGENT = "user-agent", CONTENT_TYPE = "content-type", ACCESS_CONTROL_ALLOW_ORIGIN = "access-control-allow-origin", ACCESS_CONTROL_ALLOW_METHODS = "access-control-allow-methods", ACCESS_CONTROL_ALLOW_HEADERS = "access-control-allow-headers", ACCESS_CONTROL_MAX_AGE = "access-control-max-age", ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK = "access-control-allow-private-network" } declare enum HttpMethodEnum { POST = "POST", GET = "GET", OPTIONS = "OPTIONS" } declare enum HttpQueryKeysEnum { WORKFLOW_ID = "workflowId", STEP_ID = "stepId", ACTION = "action", SOURCE = "source", AGENT_ID = "agentId", EVENT = "event" } declare enum HttpStatusEnum { CONTINUE = 100, SWITCHING_PROTOCOLS = 101, PROCESSING = 102, EARLYHINTS = 103, OK = 200, CREATED = 201, ACCEPTED = 202, NON_AUTHORITATIVE_INFORMATION = 203, NO_CONTENT = 204, RESET_CONTENT = 205, PARTIAL_CONTENT = 206, AMBIGUOUS = 300, MOVED_PERMANENTLY = 301, FOUND = 302, SEE_OTHER = 303, NOT_MODIFIED = 304, TEMPORARY_REDIRECT = 307, PERMANENT_REDIRECT = 308, BAD_REQUEST = 400, UNAUTHORIZED = 401, PAYMENT_REQUIRED = 402, FORBIDDEN = 403, NOT_FOUND = 404, METHOD_NOT_ALLOWED = 405, NOT_ACCEPTABLE = 406, PROXY_AUTHENTICATION_REQUIRED = 407, REQUEST_TIMEOUT = 408, CONFLICT = 409, GONE = 410, LENGTH_REQUIRED = 411, PRECONDITION_FAILED = 412, PAYLOAD_TOO_LARGE = 413, URI_TOO_LONG = 414, UNSUPPORTED_MEDIA_TYPE = 415, REQUESTED_RANGE_NOT_SATISFIABLE = 416, EXPECTATION_FAILED = 417, I_AM_A_TEAPOT = 418, MISDIRECTED = 421, UNPROCESSABLE_ENTITY = 422, FAILED_DEPENDENCY = 424, PRECONDITION_REQUIRED = 428, TOO_MANY_REQUESTS = 429, INTERNAL_SERVER_ERROR = 500, NOT_IMPLEMENTED = 501, BAD_GATEWAY = 502, SERVICE_UNAVAILABLE = 503, GATEWAY_TIMEOUT = 504, HTTP_VERSION_NOT_SUPPORTED = 505 } declare enum ResourceEnum { WORKFLOW = "workflow", PROVIDER = "provider", STEP = "step" } /** * Novu-owned card JSON on the agent wire. * * Matches the full Chat SDK kit agents emit (`section` / `fields` / `table` / * `button` / `select` / `radio_select`) plus Novu fields on buttons * (`actionType`, `callbackUrl`, `disabled`). Chat SDK stays the authoring * frontend (`@novu/framework`); this type is the contract `@novu/js` and the * event protocol share. The dashboard Maily editor still authors the smaller * `@novu/shared` v1 subset (link-buttons only). * * Compatibility locks in `packages/framework/src/resources/agent/card-element-compat.test-d.ts`: * `chat.CardElement` and `@novu/stateless` `CardElement` must assign to this type. * Do not add `chat` or `@novu/stateless` as a dependency here. */ type CardElementTextElement = { type: 'text'; content: string; style?: 'plain' | 'bold' | 'muted'; }; type CardElementImageElement = { type: 'image'; url: string; alt?: string; }; type CardElementDividerElement = { type: 'divider'; }; /** Presentational inline hyperlink (Chat SDK `CardLink`). */ type CardElementLinkElement = { type: 'link'; label: string; url: string; }; type CardElementLinkButtonElement = { type: 'link-button'; label: string; url: string; style?: 'primary' | 'danger' | 'default'; /** Optional author-provided id; platform serializers use it (e.g. Slack `action_id`). */ id?: string; }; /** Interactive action button (Chat SDK `Button`). Drives `sendAction` in web chat. */ type CardElementButtonElement = { type: 'button'; id: string; label: string; style?: 'primary' | 'danger' | 'default'; actionType?: 'action' | 'modal'; callbackUrl?: string; value?: string; disabled?: boolean; }; type CardElementSelectOptionElement = { label: string; value: string; description?: string; }; /** Chat SDK `Select`. */ type CardElementSelectElement = { type: 'select'; id: string; label: string; options: CardElementSelectOptionElement[]; initialOption?: string; optional?: boolean; placeholder?: string; }; /** Chat SDK `RadioSelect`. */ type CardElementRadioSelectElement = { type: 'radio_select'; id: string; label: string; options: CardElementSelectOptionElement[]; initialOption?: string; optional?: boolean; }; type CardElementActionChild = CardElementLinkButtonElement | CardElementButtonElement | CardElementSelectElement | CardElementRadioSelectElement; type CardElementActionsElement = { type: 'actions'; children: CardElementActionChild[]; }; type CardElementFieldElement = { type: 'field'; label: string; value: string; }; type CardElementFieldsElement = { type: 'fields'; children: CardElementFieldElement[]; }; type CardElementTableElement = { type: 'table'; headers: string[]; rows: string[][]; align?: Array<'left' | 'center' | 'right'>; }; type CardElementSectionElement = { type: 'section'; children: CardElementChild[]; }; /** Includes top-level `button` — agents emit that shape, not only `actions` wrappers. */ type CardElementChild = CardElementTextElement | CardElementImageElement | CardElementDividerElement | CardElementLinkElement | CardElementButtonElement | CardElementActionsElement | CardElementSectionElement | CardElementFieldsElement | CardElementTableElement; type CardElement = { type: 'card'; title?: string; subtitle?: string; imageUrl?: string; children: CardElementChild[]; }; type AgentMessageRole = 'user' | 'assistant'; type AgentToolSource = { type: 'builtin'; } | { type: 'custom'; } | { type: 'mcp'; serverName: string; }; type AgentToolResultContent = { type: 'text'; text: string; } | { type: 'citation'; url: string; title?: string; excerpts?: string[]; } | { type: 'json'; value: unknown; } | { type: 'media'; mediaType: string; data: string; name?: string; } | { type: 'unknown'; providerType: string; data: Record; }; type AgentMessageContent = { markdown: string; } | { card: CardElement; }; interface AgentFileRef { fileId: string; name?: string; mediaType?: string; /** Transitional: inline base64 payload until the pre-upload path ships. Same 5 MB limit as the reply API. */ data?: string; /** Transitional: publicly-accessible URL until the pre-upload path ships. Same limits as the reply API. */ url?: string; } declare const AGENT_EVENT_PROTOCOL_VERSION: 1; interface AgentEventUsage { inputTokens?: number; outputTokens?: number; totalTokens?: number; } type AgentRunOutcome = 'completed' | 'paused' | 'aborted'; type AgentFinishReason = 'stop' | 'length' | 'refused' | 'other'; interface AgentApprovalRequest { approvalId: string; toolUseId: string; toolName: string; input?: Record; source?: AgentToolSource; /** * Server-minted platform action ids for headless / card UIs to echo back. * Clients must not invent these — grammars differ across runtimes. */ approveActionId?: string; denyActionId?: string; /** Server-minted always-allow-this-tool action id. Echo via respondToAction / card click. */ trustToolActionId?: string; /** Server-minted always-allow-MCP-server action id (MCP tools only). */ trustServerActionId?: string; } type AgentSignal = { type: 'metadata'; action: 'set'; key: string; value: unknown; } | { type: 'metadata'; action: 'delete'; key: string; } | { type: 'metadata'; action: 'clear'; } | { type: 'trigger'; workflowId: string; to?: unknown; payload?: Record; } | { type: 'human'; kind: 'ask' | 'approve' | 'choose' | 'tell'; prompt: string; requestId: string; options?: string[]; from?: string; ttlSeconds?: number; to?: string | string[]; }; type AgentEvent = { type: 'run-start'; } | { type: 'run-finish'; outcome: AgentRunOutcome; finishReason?: AgentFinishReason; usage?: AgentEventUsage; approvals?: AgentApprovalRequest[]; } | { type: 'run-error'; message: string; code?: string; } | { type: 'step-start'; name?: string; index?: number; } | { type: 'step-end'; name?: string; index?: number; usage?: AgentEventUsage; } | { type: 'message'; messageId: string; /** Who authored this durable message. Streaming events stay assistant-only and omit role. */ role: AgentMessageRole; content: AgentMessageContent; files?: AgentFileRef[]; } | { type: 'message-start'; messageId: string; } | { type: 'message-delta'; messageId: string; delta: string; } | { type: 'message-end'; messageId: string; content?: AgentMessageContent; files?: AgentFileRef[]; } | { type: 'thinking-start'; thinkingId: string; } | { type: 'thinking-delta'; thinkingId: string; delta: string; } | { type: 'thinking-end'; thinkingId: string; } | { type: 'source'; messageId: string; sourceType: 'url' | 'document'; url?: string; title?: string; filename?: string; } | { type: 'tool-use-start'; toolUseId: string; toolName: string; source?: AgentToolSource; } | { type: 'tool-use-delta'; toolUseId: string; delta: string; } | { type: 'tool-use-done'; toolUseId: string; toolName: string; input?: Record; source?: AgentToolSource; } | { type: 'tool-use-result'; toolUseId: string; content: AgentToolResultContent[]; isError?: boolean; } | ({ type: 'tool-approval-request'; /** Stable assistant message id used to preserve the approval's timeline position during history replay. */ messageId?: string; /** When true, no companion message carries the approval UI. The consumer should render its default approval card. */ deliverCard?: boolean; } & AgentApprovalRequest) | { type: 'tool-approval-response'; approvalId: string; decision: 'approved' | 'denied'; reason?: string; automatic?: boolean; } | { type: 'mcp-connection-request'; actionId: string; mcpId: string; displayName: string; authorizeUrl: string; authorizeUrlWithAutoApprove?: string; } | { type: 'mcp-connection-result'; actionId: string; mcpId: string; status: 'connected' | 'failed'; message?: string; } | { type: 'resolve'; summary?: string; } | { type: 'signal'; signal: AgentSignal; } | { type: 'channel.typing'; state: 'on' | 'off'; status?: string; } | { type: 'channel.edit'; messageId: string; content: AgentMessageContent; files?: AgentFileRef[]; } | { type: 'channel.delete'; messageId: string; } | { type: 'channel.reaction'; messageId: string; emoji: string; op: 'add' | 'remove'; } | { type: 'connection.error'; source: 'mcp'; serverName: string; reason: 'authentication' | 'connection'; message: string; } | { type: 'provider-event'; provider: string; event: string; data: unknown; } | { type: 'custom'; name: string; data: unknown; }; interface AgentEventEnvelope { version: typeof AGENT_EVENT_PROTOCOL_VERSION; conversationId: string; /** Public `conv_*` identifier. Clients receive only this id, never `conversationId`. */ conversationIdentifier?: string; agentId: string; runId: string; turnId: string; sequence: number; timestamp: string; event: AgentEvent; } /** * Check if the object is a native error. * * This method relies on `Object.prototype.toString()` behavior. It is possible to obtain * an incorrect result when the object argument has a non `Error`-suffixed `name` property. * * @param object - The object to check. * @returns `true` if the object is a native error, `false` otherwise. */ declare const isNativeError: (object: unknown) => object is Error; /** * Base error class. */ declare abstract class FrameworkError extends Error { /** * HTTP status code. */ abstract readonly statusCode: HttpStatusEnum; /** * Additional data that can be used to provide more information about the error. */ data?: unknown; /** * The error code, which is used to identify the error type. */ abstract readonly code: ErrorCodeEnum; } declare abstract class NotFoundError extends FrameworkError { statusCode: HttpStatusEnum; } declare abstract class BadRequestError extends FrameworkError { statusCode: HttpStatusEnum; } declare abstract class UnauthorizedError extends FrameworkError { statusCode: HttpStatusEnum; } declare abstract class ServerError extends FrameworkError { data: { /** * The stack trace of the error. */ stack: string; }; constructor(message: string, { cause }?: Partial<{ cause: unknown; }>); } declare abstract class ConflictError extends FrameworkError { statusCode: HttpStatusEnum; } declare abstract class ForbiddenError extends FrameworkError { statusCode: HttpStatusEnum; } /** * A `BridgeError` is an unexpected error that occurs within the Bridge application. * * This error is used to wrap unknown errors that occur within the Bridge application, * such as errors due to unsupported runtime environments. */ declare class BridgeError extends ServerError { statusCode: HttpStatusEnum; code: ErrorCodeEnum; constructor(cause: unknown); } declare class ExecutionStateCorruptError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, stepId: string); } declare class ExecutionEventPayloadInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, data: unknown); } declare class ExecutionEventControlsInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, data: unknown); } declare class ExecutionStateControlsInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, stepId: string, data: unknown); } declare class ExecutionStateOutputInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, stepId: string, data: unknown); } declare class ExecutionStateResultInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, stepId: string, data: unknown); } declare class StepControlCompilationFailedError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, stepId: string, data: unknown); } declare class ExecutionProviderOutputInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, stepId: string, providerId: string, data: unknown); } declare class WorkflowPayloadInvalidError extends BadRequestError { code: ErrorCodeEnum; constructor(workflowId: string, data: unknown); } declare class PlatformError extends Error { /** * HTTP status code. */ statusCode: HttpStatusEnum; /** * Additional data that can be used to provide more information about the error. */ data: unknown; code: ErrorCodeEnum; constructor(statusCode: HttpStatusEnum, code: string, message: string); } /** * Check if the error is a `FrameworkError`. * * A `FrameworkError` is an error thrown by the Framework. * * @param error - The error to check. * @returns `true` if the error is a `FrameworkError`, `false` otherwise. */ declare const isFrameworkError: (error: unknown) => error is FrameworkError; declare class MethodNotAllowedError extends FrameworkError { code: ErrorCodeEnum; statusCode: HttpStatusEnum; message: string; } declare class InvalidActionError extends BadRequestError { code: ErrorCodeEnum; constructor(action: string, allowedActions: Object); } declare class MissingSecretKeyError extends BadRequestError { code: ErrorCodeEnum; constructor(); } declare abstract class ResourceConflictError extends ConflictError { constructor(resource: ResourceEnum, id: string); } declare abstract class ResourceNotFoundError extends NotFoundError { constructor(resource: ResourceEnum, id: string); } declare abstract class ResourceExecutionFailed extends ServerError { statusCode: HttpStatusEnum; constructor(resource: ResourceEnum, id: string, action: PostActionEnum, cause: unknown); } declare class ProviderNotFoundError extends ResourceNotFoundError { code: ErrorCodeEnum; constructor(id: string); } declare class ProviderExecutionFailedError extends ResourceExecutionFailed { code: ErrorCodeEnum; constructor(id: string, action: PostActionEnum, cause: unknown); } declare class SignatureMismatchError extends UnauthorizedError { code: ErrorCodeEnum; constructor(); } declare class SignatureNotFoundError extends UnauthorizedError { code: ErrorCodeEnum; constructor(); } declare class SignatureInvalidError extends UnauthorizedError { code: ErrorCodeEnum; constructor(); } declare class SignatureExpiredError extends UnauthorizedError { code: ErrorCodeEnum; constructor(); } declare class SigningKeyNotFoundError extends UnauthorizedError { code: ErrorCodeEnum; constructor(); } declare class SignatureVersionInvalidError extends UnauthorizedError { code: ErrorCodeEnum; constructor(); } declare class StepNotFoundError extends ResourceNotFoundError { code: ErrorCodeEnum; constructor(id: string); } declare class StepAlreadyExistsError extends ResourceConflictError { code: ErrorCodeEnum; constructor(id: string); } declare class StepExecutionFailedError extends ResourceExecutionFailed { code: ErrorCodeEnum; constructor(id: string, action: PostActionEnum, cause: unknown); } declare class WorkflowNotFoundError extends ResourceNotFoundError { code: ErrorCodeEnum; constructor(id: string); } declare class WorkflowAlreadyExistsError extends ResourceConflictError { code: ErrorCodeEnum; constructor(id: string); } /** * Format a list of items for digest notifications with configurable behavior * Default formatting: * - 1 item: "John" * - 2 items: "John and Josh" * - 3 items: "John, Josh and Sarah" * - 4+ items: "John, Josh and 2 others" * * @param array The array of items to format * @param maxNames Maximum names to show before using "others" * @param keyPath Path to extract from objects (e.g., "name" or "profile.name") * @param separator Custom separator between names (default: ", ") * @returns Formatted string * * Examples: * {{ actors | digest }} => "John, Josh and 2 others" * {{ actors | digest: 2 }} => "John, Josh and 3 others" * {{ users | digest: 2, "name" }} => For array of {name: string} * {{ users | digest: 2, "profile.name", "•" }} => "John • Josh and 3 others" */ declare function digest(array: unknown, maxNames?: number, keyPath?: string, separator?: string): string; /** * Creates a pluralized string based on the count of the item. * Example: * - 0, "event" -> "" * - 1, "event" -> 1 event * - 2, "event" -> 2 events * - 1, "event", "", false -> event * - 2, "event", "", false -> events * * @param item The item to pluralize * @param singular The singular form of the word * @param plural The plural form of the word * @param showCount Whether to include the count in the output (default: true) */ declare function pluralize(item: unknown, singular?: string, plural?: string, showCount?: 'true' | 'false'): string; type LiquidFilterIssue = { message: string; begin: number; end: number; value: string; }; /** * Format a list of items for digest notifications with configurable behavior * Default formatting: * - 1 item: "John" * - 2 items: "John and Josh" * - 3 items: "John, Josh, and Sarah" * - 4+ items: "John, Josh, and 2 others" * * @param array The array of items to format * @param keyPath Path to the property to extract from objects (e.g., "name" or "profile.name") * @param limit Maximum number of words to show before the "overflowSuffix" * @param overflowSuffix The word to use for the items above the limit, e.g. "other" * @param wordsConnector The separator between words (default: ", ") * @param twoWordsConnector The separator for 2 words (default: " and ") * @param lastWordConnector The separator for 3+ words (default: ", and ") * @returns Formatted string, for example: "John, Josh and 2 others" */ declare function toSentence(array: unknown, keyPath?: string, limit?: number, overflowSuffix?: string, wordsConnector?: string, twoWordsConnector?: string, lastWordConnector?: string): string; /** * Validate the arguments for the toSentence filter * @param options Options for validation. Can include requireKeyPath to make keyPath required. * @param args The arguments for the toSentence filter * @returns An array of issues with the validation errors */ declare function toSentenceArgsValidator(options?: { requireKeyPath?: boolean; }, ...args: Filter['args']): LiquidFilterIssue[]; type FilterValidators = { [key: string]: (...args: any[]) => LiquidFilterIssue[]; }; declare const FILTER_VALIDATORS: FilterValidators; declare const RUNTIME_CONTEXT_BRAND: unique symbol; interface AgentRuntimeContext extends AgentHandlerContext { readonly [RUNTIME_CONTEXT_BRAND]: true; emitToolResult(result: ToolResult): void; emitToolApprovalRequest(request: ToolApprovalRequestPayload): void; replyApprovalCard(card: ToolApprovalCard): Promise; asMessageContext(): AgentMessageContext; } /** Pending side effects queued between replies, drained atomically before each turn action. */ interface SideEffectsSnapshot { toolApprovalRequest: ToolApprovalRequestPayload | null; signals: Signal[]; toolResults: ToolResult[]; addReactions: AddReactionPayload[]; deleteMessages: DeleteMessagePayload[]; resolve: { summary?: string; } | null; } /** * A turn's delivery mechanism. Legacy bridges POST a single `AgentReplyPayload` per action; * SDK-native runs emit one or more `AgentEvent`s to the outbox. `AgentContextImpl` selects one * implementation per run and delegates to it, instead of branching on the mode at every call site. */ interface TurnTransport { sendReply(reply: ReplyContent, sideEffects: SideEffectsSnapshot): Promise; /** * Returns `'unaddressable'` when the card was rendered but there is no client-addressable * message handle for it (event mode: the sink owns approval-card rendering, so there is no * id it could later resolve an edit/delete against). */ sendApprovalCard(card: ToolApprovalCard, sideEffects: SideEffectsSnapshot): Promise; editMessage(messageId: string, reply: ReplyContent): Promise; deleteMessage(messageId: string): Promise; setTyping(op: TypingOp): Promise; flushSideEffects(sideEffects: SideEffectsSnapshot): Promise; emitCustom(name: string, data: unknown): Promise; queueRunStart(): void; emitRunFinish(outcome: AgentRunOutcome): Promise; reportTurnError(message?: string): Promise; } declare class ReplyHandleImpl implements ReplyHandle { private readonly transport; messageId: string; platformThreadId: string; /** @internal set when the handler calls `edit()`; dispatch skips default approval card cleanup. */ editedByHandler: boolean; constructor(messageId: string, platformThreadId: string, transport: TurnTransport); edit(content: MessageContent, options?: { files?: FileRef[]; }): Promise; delete(): Promise; } declare class AgentContextImpl implements AgentRuntimeContext { readonly [RUNTIME_CONTEXT_BRAND] = true; readonly event: AgentEventEnum; readonly action: AgentAction | null; readonly message: AgentMessage | null; readonly reaction: AgentReaction | null; readonly conversation: AgentConversation; readonly subscriber: AgentSubscriber | null; readonly context: AgentContextPayload | null; readonly notification: AgentNotification | null; readonly history: AgentHistoryEntry[]; readonly platform: string; readonly platformContext: AgentPlatformContext; readonly humanResponse: AgentHumanResponse | null; readonly typing: TypingControl; readonly toolApproval: ToolApprovalControl; readonly metadata: { get(key: string): unknown; set(key: string, value: unknown): void; delete(key: string): void; clear(): void; readonly current: Readonly>; }; private _signals; private _toolResults; private _pendingToolApprovalRequest; private _pendingReactions; private _pendingDeletes; private _resolveSignal; private _metadataState; private readonly _toolApprovalConfig?; private readonly _transport; constructor(request: AgentBridgeRequest, secretKey: string, toolApprovalConfig?: ToolApprovalConfig); asMessageContext(): AgentMessageContext; reply(content: MessageContent, options?: { files?: FileRef[]; }): Promise; replyApprovalCard(card: ToolApprovalCard): Promise; /** @internal Build a handle to an already-posted message (used to resume an approval). */ createReplyHandle(messageId: string): ReplyHandleImpl; emit(event: { name: string; data: unknown; }): Promise; resolve(summary?: string): void; trigger(workflowId: string, opts?: { to?: TriggerRecipientsPayload; payload?: Record; }): void; ask(question: string, opts?: HumanAskApproveOptions): string; approve(action: string, opts?: HumanAskApproveOptions): string; choose(question: string, options: string[], opts?: HumanChooseOptions): string; tell(message: string, opts?: HumanTellOptions): string; private queueHumanSignal; /** @internal Queue a gated tool call for the ledger; flushed with the next reply. */ emitToolApprovalRequest(request: ToolApprovalRequestPayload): void; /** @internal Queue a tool-call outcome to be recorded in history; flushed with the next reply. */ emitToolResult(result: ToolResult): void; addReaction(messageId: string, emojiName: Emoji): void; deleteMessage(messageId: string): void; /** @internal Enqueue run-start before handler execution; flushed with the first emit. */ queueRunStart(): void; /** @internal Enqueue and flush run-finish as the terminal success event. */ emitRunFinish(options: { outcome: AgentRunOutcome; }): Promise; /** Best-effort failure report to Novu. Never throws. */ reportTurnError(message?: string): Promise; /** * Flush any remaining signals that weren't sent with reply(). * Called internally after onResolve returns. */ flush(): Promise; private _hasPendingSideEffects; /** Atomically drains all queued side effects into a snapshot for the transport to deliver. */ private _drainSideEffectsSnapshot; } /** Maximum outbound body length included before the payload. */ declare const WORKFLOW_ORIGIN_LINE_MAX_CHARS = 500; declare function buildWorkflowOriginLine(workflowIdentifier: string, messageContent: string): string; declare function buildWorkflowOriginInjection(workflowIdentifier: string, messageContent: string, payload: Record): string; /** * Creates a configured Liquid instance with Novu's default settings. * * @param options - LiquidJS options. Note: By default, this uses a custom outputEscape function * that escapes special JSON characters. If you need different escaping behavior (e.g., for HTML * rendering), you can override the outputEscape function in the options. */ declare function createLiquidEngine(options?: LiquidOptions): Liquid; declare function repairJsonString(value: string): string; declare function compileJsonControlValues(values: Record, context: Record, liquidEngine?: ReturnType): Promise>; export { AgentBridgeRequest, AgentContextImpl, type AgentEvent, AgentEventEnum, type AgentEventEnvelope, type AgentRuntimeContext, BadRequestError, BridgeError, ConflictError, DeleteMessagePayload, ErrorCodeEnum, ExecutionEventControlsInvalidError, ExecutionEventPayloadInvalidError, ExecutionProviderOutputInvalidError, ExecutionStateControlsInvalidError, ExecutionStateCorruptError, ExecutionStateOutputInvalidError, ExecutionStateResultInvalidError, FILTER_VALIDATORS, ForbiddenError, FrameworkError, HttpHeaderKeysEnum, HttpMethodEnum, HttpQueryKeysEnum, HttpStatusEnum, InvalidActionError, type LiquidFilterIssue, MethodNotAllowedError, MissingSecretKeyError, NotFoundError, NovuApiEndpointsEnum, PlatformError, PostActionEnum, ProviderExecutionFailedError, ProviderNotFoundError, ReplyContent, ResourceConflictError, ResourceEnum, ResourceExecutionFailed, ResourceNotFoundError, SIGNATURE_TIMESTAMP_TOLERANCE, SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES, SentMessageInfo, ServerError, Signal, SignatureExpiredError, SignatureInvalidError, SignatureMismatchError, SignatureNotFoundError, SignatureVersionInvalidError, SigningKeyNotFoundError, StepAlreadyExistsError, StepControlCompilationFailedError, StepExecutionFailedError, StepNotFoundError, ToolApprovalRequestPayload, ToolResult, UnauthorizedError, WORKFLOW_ORIGIN_LINE_MAX_CHARS, WorkflowAlreadyExistsError, WorkflowNotFoundError, WorkflowPayloadInvalidError, buildWorkflowOriginInjection, buildWorkflowOriginLine, compileJsonControlValues, createLiquidEngine, digest, isFrameworkError, isNativeError, pluralize, repairJsonString, toSentence, toSentenceArgsValidator };