import { IAction, IReaction, ITrigger } from './step'; import { TriggerTypes } from './triggers'; import { IGeneralStatus } from './status'; import { IAgentMcp } from './agent-mcp'; export declare enum IComponentType { activity = "activity", agent = "agent", aistep = "aistep", audience = "audience", campaign = "campaign", campaignAutomation = "campaignAutomation", extension = "extension", flow = "flow", genieTrainer = "genieTrainer", knowledgeGenie = "knowledgeGenie", notification = "notification", salesDesk = "salesDesk", scope = "scope", start = "start", step = "step", webhook = "webhook", customAgent = "customAgent", customAgentV2 = "customAgentV2", voiceUpsellAgent = "voiceUpsellAgent", orisVoice = "orisVoice", customVoiceAgent = "customVoiceAgent", orisB2C = "orisB2C", faqAgent = "faqAgent" } export declare const ComponentTypeEnum: string[]; export interface IFunnel { funnelId: string; } export interface IAiBranches { finish?: number; menu?: number; human?: number; finishUid?: string; menuUid?: string; humanUid?: string; } export interface IAi { agentId: string; branches: IAiBranches; } export interface IAiTrainer { type: 'collection' | 'library'; ids: string[]; responseForm: 'summarized' | 'full'; prompt: string; topicBlocklist: string[]; genieId: string; intents: { intent: string; stepId: number; stepUid?: string; }[]; } export interface IKnowledgeGenie { genieId: string; intents: { intent: string; stepId: number; stepUid?: string; }[]; } interface VectorStoreFilter { type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte'; property: string; value: string | number; } interface CustomAgentIntent { id: string; sender: 'user' | 'ai'; intent?: string; keywords?: string[]; stepId: number; stepUid?: string; } export interface CustomAgent { prompt: string; model: { name: string; temperature?: number; }; tools: string[]; mcp: IAgentMcp[]; intents: CustomAgentIntent[]; vectorStore?: string; vectorStoreFilters?: VectorStoreFilter[]; copilotConversationId?: string; copilotSubAgent?: boolean; yaloTools?: Record; richFormatting?: boolean; nativeMultimedia?: boolean; enableImages?: boolean; enableAudios?: boolean; maxInputLength?: number; strictInstructions?: boolean; } interface ICustomAgentV2Flow { flowId: string; step?: string; stepUid?: string; stepName?: string; stepType?: string; activityId?: string; } interface ICustomAgentV2TransitionLogic { type: 'menu' | 'human' | 'custom' | 'error'; key?: string; description?: string; redirectionStep: number; redirectionStepUid?: string; } interface ICustomAgentV2Guardrails { enabled?: boolean; prohibitedTopics?: string; customPrompt?: string; fallbackMessage?: string; } interface ICustomAgentV2Locale { enabled?: boolean; multilingual?: boolean; defaultLanguage?: string; customPrompt?: string; } interface ICustomAgentV2AudioTranscription { hints?: string; advancedModel?: boolean; } interface ICustomAgentV2ImageTranscription { customInstructions?: string; } interface ICustomAgentV2SkillBase { enabled?: boolean; silenceFillerEnabled?: boolean; } interface ICustomAgentV2OutputFormattingConfig { richFormatting?: boolean; nativeMultimedia?: boolean; } type ICustomAgentV2FaqFilterOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin'; interface ICustomAgentV2FaqAttributeFilter { key: string; value: string | number | boolean | string[]; type?: ICustomAgentV2FaqFilterOperator; } interface ICustomAgentV2FaqCollectionConfig { name: string; description: string; filters?: ICustomAgentV2FaqAttributeFilter[]; } export interface ICustomAgentV2FaqSkill extends ICustomAgentV2SkillBase { triggerDescription?: string; vectorStoreId: string; collections?: ICustomAgentV2FaqCollectionConfig[]; maxNumResults?: number; scoreThreshold?: number; retrievalGuidance?: string; responseGuidance?: string; outputFormatting?: ICustomAgentV2OutputFormattingConfig; hooks?: ICustomAgentV2SkillHook[]; } interface ICustomAgentV2ModelConfig { name?: string; temperature?: number; historyMaxMessages?: number; } interface ICustomAgentV2McpServerConfig { url: string; transport?: 'streamable_http' | 'sse'; headers?: Record; } interface ICustomAgentV2MemoryConfig { storeEnabled?: boolean; retrieveEnabled?: boolean; keysEnabled?: boolean; } interface ICustomAgentV2TransferConfig { enabled?: boolean; } interface ICustomAgentV2LuaToolConfig { name: string; description: string; code: string; paramsSchema?: Record; } export interface ICustomAgentV2CustomSkill extends ICustomAgentV2SkillBase { triggerDescription: string; prompt?: string; model?: ICustomAgentV2ModelConfig; outputFormatting?: ICustomAgentV2OutputFormattingConfig; mcpServers?: Record; memory?: ICustomAgentV2MemoryConfig; transfer?: ICustomAgentV2TransferConfig; luaTools?: ICustomAgentV2LuaToolConfig[]; hooks?: ICustomAgentV2SkillHook[]; } export type ICustomAgentV2Skill = ICustomAgentV2FaqSkill | ICustomAgentV2CustomSkill; interface ICustomAgentV2LuaHook { enabled?: boolean; code: string; } interface ICustomAgentV2LuaHooks { startSession?: ICustomAgentV2LuaHook; } interface ICustomAgentV2SkillHook { enabled: boolean; trigger: ICustomAgentV2SkillHookTrigger; action: ICustomAgentV2SkillHookAction; } interface ICustomAgentV2AfterExecuteTrigger { type: 'afterExecute'; } type ICustomAgentV2SkillHookTrigger = ICustomAgentV2AfterExecuteTrigger; interface ICustomAgentV2LuaAction { type: 'lua'; code: string; mode?: 'sync' | 'async'; } type ICustomAgentV2SkillHookAction = ICustomAgentV2LuaAction; interface ICustomAgentV2OrchestratorConfig { model?: ICustomAgentV2ModelConfig; customInstruction?: string; maxLoopCount?: number; } export interface CustomAgentV2 { name: string; objective?: string; flow: ICustomAgentV2Flow; skills?: Record; transitionLogics?: ICustomAgentV2TransitionLogic[]; guardrails?: ICustomAgentV2Guardrails; locale?: ICustomAgentV2Locale; audioTranscription?: ICustomAgentV2AudioTranscription; imageTranscription?: ICustomAgentV2ImageTranscription; orchestrator?: ICustomAgentV2OrchestratorConfig; luaHooks?: ICustomAgentV2LuaHooks; brandGuidelines?: string; } interface IOrisTextCustomer { id: string; storefront: string; } interface IOrisTextLocale { language: string; region: string; } interface IOrisTextTransitionLogic { type: 'menu' | 'human' | 'error' | 'custom'; description?: string; redirectionStep: number; redirectionStepUid?: string; } interface IOrisTextEnabledToggle { enabled?: boolean; } interface IOrisTextAudioTranscription { advancedLanguageModelEnabled?: boolean; hints?: string; } interface IOrisTextOrderTakingTransitionLogic { type: 'confirmation'; redirectionStep: number; redirectionStepUid?: string; } interface IOrisTextClosingQuestions { enabled?: boolean; customInstructions?: string; } interface IOrisTextAutoAssumeProductGivenHistory { enabled?: boolean; minFrequency?: number; } interface IOrisTextOrderTakingData { customGuidelines?: string; closingQuestions?: IOrisTextClosingQuestions; transitionLogics?: IOrisTextOrderTakingTransitionLogic[]; assumeQuantity?: boolean; silenceFillerEnabled?: boolean; autoAssumeProductGivenHistory?: IOrisTextAutoAssumeProductGivenHistory; maxProductOptions?: number; showImages?: IOrisTextEnabledToggle; showLists?: IOrisTextEnabledToggle; } interface IOrisTextSuggestedOrderData { customGuidelines?: string; enabledSmartCartSuggestion?: boolean; enableImage?: boolean; showCatalogLink?: boolean; suggestionMode?: 'active' | 'passive'; silenceFillerEnabled?: boolean; } interface IOrisTextCrossSellData { customGuidelines?: string; description?: string; skus?: string[]; } interface IOrisTextUpSellData { customGuidelines?: string; description?: string; fallbackMinutes: number; enableImage?: boolean; type?: 'sku' | 'promotion'; skus?: string[]; enableSmartSuggestion?: boolean; promotionIds?: string[]; sourcePriority?: ('smart' | 'cart_eligible' | 'gmv')[]; characterization?: IOrisTextEnabledToggle; } interface IOrisTextShowCatalogData { customGuidelines?: string; } interface IOrisTextShowPastOrdersData { customGuidelines?: string; } interface IOrisTextShowPromotionsData { customGuidelines?: string; presentationType?: 'text' | 'carousel'; } interface IOrisTextCustomResponseData { name?: string; triggerInstructions: string; prompt: string; } interface IOrisTextFollowUpData { customGuidelines: string; firstFollowUp: number; secondFollowUp: number; schedule?: Record; timezone: string; } export type IOrisTextSkill = { type: 'order_taking'; data: IOrisTextOrderTakingData; } | { type: 'suggested_order'; data: IOrisTextSuggestedOrderData; } | { type: 'cross_sell'; data: IOrisTextCrossSellData; } | { type: 'up_sell'; data: IOrisTextUpSellData; } | { type: 'show_catalog'; data: IOrisTextShowCatalogData; } | { type: 'show_past_orders'; data: IOrisTextShowPastOrdersData; } | { type: 'show_promotions'; data: IOrisTextShowPromotionsData; } | { type: 'custom_response'; data: IOrisTextCustomResponseData; } | { type: 'follow_up'; data: IOrisTextFollowUpData; }; export type IOrisTextSource = 'mirror' | 'editor'; export interface OrisText { source: IOrisTextSource; objective?: string; customer?: IOrisTextCustomer; transitionLogics?: IOrisTextTransitionLogic[]; skills?: IOrisTextSkill[]; defaultLocale?: IOrisTextLocale; enableQuickReply?: boolean; showCatalogLink?: boolean; showOutOfStock?: IOrisTextEnabledToggle; largeCatalog?: IOrisTextEnabledToggle; audioTranscription?: IOrisTextAudioTranscription; } export interface FaqAgent { systemPrompt: string; fallbackMessage: string; confidenceThreshold?: number; searchModel?: 'semantic'; temperature?: number; tools?: string[]; intents?: CustomAgentIntent[]; copilotConversationId?: string; } export interface VoiceUpsellAgent { storefront: string; skus: string[]; language: 'en' | 'es' | 'pt-br'; firstMessage: string; promptVariables: { userName: string; agentName: string; companyName: string; customGuidance: string; reasonWhy: string; }; finishStep: number; finishStepUid?: string; } interface IVoiceFrom { phoneNumber: string; } interface IOrderTakingSkusMission { type: 'order_taking_skus'; skus: string[]; } interface IOrderTakingMission { type: 'order_taking'; } interface IUpsellSkusMission { type: 'upsell_skus'; skus: string[]; } interface ICustomMission { type: 'custom'; prompt: string; } export type IAgentMission = IOrderTakingSkusMission | IOrderTakingMission | IUpsellSkusMission | ICustomMission; export interface OrisVoice { id?: string; agentName: string; companyName: string; customerName: string; firstMessage: string; brandGuidelines?: string; guardrails?: { prohibitedTopics?: string; }; voice: { code: string; }; commerceSettings: { customerCode: string; storefrontName: string; }; flow: { flowId: string; step: string; stepUid?: string; stepName?: string; stepType: string; activityId: string; }; call: { events: { endCall: { step: string; stepUid?: string; }; error: { step: string; stepUid?: string; }; }; }; gender: string; localeCode: string | 'en-US' | 'es-MX' | 'pt-BR'; additionalInformation?: string; slangExpressions?: string; from?: IVoiceFrom; agentMission?: IAgentMission; } interface JSONSchema { type?: string | string[]; properties?: Record; required?: string[]; additionalProperties?: boolean; description?: string; [key: string]: unknown; } interface IVoiceAgentModels { conversation?: string; analysis?: string; idleMessage?: string; realtimeModel?: string; realtimeVoice?: string; } interface IVoiceAgentLuaTool { name: string; description: string; code: string; paramsSchema?: Record; } interface IVoiceAgentLuaHook { enabled?: boolean; code: string; } interface IVoiceAgentLuaHooks { beforeCall?: IVoiceAgentLuaHook; } interface IVapiStartSpeakingPlan { waitSeconds?: number; onPunctuationSeconds?: number; onNoPunctuationSeconds?: number; onNumberSeconds?: number; } interface IVapiStopSpeakingPlan { numWords?: number; voiceSeconds?: number; } interface IVapiTuning { startSpeakingPlan?: IVapiStartSpeakingPlan; stopSpeakingPlan?: IVapiStopSpeakingPlan; } interface IVoiceAgentProviderConfig { vapi?: IVapiTuning; } export interface CustomVoiceAgent { id?: string; conversationPrompt: string; analysisPrompt: string; analysisResponseStructure: JSONSchema; firstMessage: string; localeCode: string | 'en-US' | 'es-MX' | 'pt-BR'; voice: { code: string; }; flow: { flowId: string; step: string; stepUid?: string; stepName?: string; stepType?: string; activityId?: string; }; call: { events: { endCall: { step: string; stepUid?: string; }; error: { step: string; stepUid?: string; }; }; }; from?: IVoiceFrom; transport?: 'text' | 'realtime'; models?: IVoiceAgentModels; luaTools?: IVoiceAgentLuaTool[]; luaHooks?: IVoiceAgentLuaHooks; providerConfig?: IVoiceAgentProviderConfig; } export interface IComponent { uid?: string; componentId: number; activityId: string; name?: string; description?: string; type: IComponentType; status: IGeneralStatus; actions?: IAction[]; reactions?: IReaction[]; triggers?: ITrigger[]; fallbacks?: IAction[]; uiConfig?: IComponentConfig; scopeId: string | null; invalidSteps?: boolean; funnel?: IFunnel[]; ai?: IAi; customAgent?: CustomAgent; customAgentV2?: CustomAgentV2; orisText?: OrisText; voiceUpsellAgent?: VoiceUpsellAgent; AITrainer?: IAiTrainer; knowledgeGenie?: IKnowledgeGenie; createdAt: Date; campaignAutomation?: ICampaignAutomation; audience?: IAudience; notification?: INotification; orisVoice?: OrisVoice; customVoiceAgent?: CustomVoiceAgent; faqAgent?: FaqAgent; } export interface IComponentLight { _id?: string; workflowId: string; componentId: number; activityId: string; name?: string; description?: string; type: IComponentType; status: IGeneralStatus; actions?: IAction[]; reactions?: IReaction[]; triggers?: ITrigger[]; fallbacks?: IAction[]; scopeId: string | null; invalidSteps?: boolean; funnel?: IFunnel[]; } export interface IContentThenUI { action?: 'goto' | 'save' | 'webhook' | 'script'; value?: string; webhookUrl?: string; webhookBody?: string; webhookAttrName?: string; webhookHeaders?: { key: string; value: string; }; webhookStatusTransitions?: { status: string[]; action: 'goto' | 'save' | 'script'; value: string; }[]; } export interface IContentUI { condition?: { type?: 'contains' | 'isEqualTo' | 'regex' | 'intent' | 'flow'; comparison?: string; value: string; }; then?: IContentThenUI[]; code: string; } export interface IActionUI { id: string; type: 'basic' | 'advanced' | 'fallback' | 'extension' | 'flow'; content?: IContentUI; } interface IBaseReaction { id: string; content: string; } interface IButtonsReaction extends IBaseReaction { type: 'buttons'; header?: string; footer?: string; buttons: string[]; } interface IMediaReaction extends IBaseReaction { type: 'media'; media: string; mediaType: 'audio' | 'image' | 'document' | 'video'; mediaSize: string; } interface IListReaction extends IBaseReaction { type: 'list'; listSections: { id: string; title?: string; header?: string; footer?: string; listTitle: string; options: { id: string; title: string; }[]; }[]; } interface IMessageReaction extends IBaseReaction { type: 'text'; } export type IReactionUI = IMessageReaction | IListReaction | IMediaReaction | IButtonsReaction; export interface ITriggersUI { type: TriggerTypes; config?: { triggerId?: string; triggerURL?: string; seconds?: number; }; } export interface IFlowUI { flowId: string; initialMessageConfig: { header: string; body: string; footer: string; button: string; }; screenConfig: { name: string; value: string; }[]; initRoutedFlow?: boolean; } export interface IReminderUI { isActive: boolean; delay: number; type: 'message' | 'step'; targetStep?: number | string; messages?: IReactionUI[]; } export interface IEventUI { id: string; name: string; params?: { name: string; value: string; }[]; eventType?: { id?: string; name?: string; }; } export interface ISourceUI { actions?: IActionUI[]; events?: IEventUI[]; reactions?: IReactionUI[]; reminder?: IReminderUI; triggers?: ITriggersUI[]; fallbacks?: IActionUI[]; flow?: IFlowUI; } export interface IComponentConfig { source?: ISourceUI; position: { x: number; y: number; }; } export interface LinkItem extends Omit { type: 'basic' | 'advanced'; linked?: LinkItem[]; } export interface LinkComponent { activityId: string; activityName: string; activityDescription: string; activityPosition: { activityId: string; x: number; y: number; }[]; componentName: string; componentId: number; linked: LinkItem[]; } interface ISchema { name: string; } interface IVariable { name: string; schema?: ISchema[]; } export interface ICampaignAutomation { description: string; icon: string; variables: IVariable[]; } export interface ISchedulerConfig { daysOfWeek?: string[]; endDate?: string; name: string; runOn: string; schedule: string; specificDate?: string; startDate?: string; timeUnit: string; timezone: string; } export declare enum DaysOfWeek { sunday = 0, monday = 1, tuesday = 2, wednesday = 3, thursday = 4, friday = 5, saturday = 6 } export declare enum RunOnOptions { everyDay = "everyDay", specificDays = "specificDays", specifyDate = "specifyDate" } export interface IAudience { audienceName: string; audienceId: string; callbackUrl: string; nextStepId?: number; nextStepUid?: string; schedulerConfig: ISchedulerConfig; } interface INotificationParam { name: string; value?: string; } export interface INotification { account: string; bot: string; template: string; templateId: string; templateParams: INotificationParam[]; hiddenTemplateParams: INotificationParam[]; campaignStarter?: string; campaignStarterParams: INotificationParam[]; extractPhoneFrom?: string; } export {};