@tellescope/types-models 1.255.19 → 1.256.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -586,6 +586,7 @@ export interface Organization extends Organization_readonly, Organization_requir
586
586
  customerIOFields?: string[];
587
587
  customerIOIdField?: string;
588
588
  createEnduserForms?: string[];
589
+ defaultSummaryJourneyId?: string;
589
590
  creditCount?: number;
590
591
  creditTrialStartedAt?: Date;
591
592
  hasIntegrations?: string[];
@@ -1085,7 +1086,20 @@ export interface Enduser extends Enduser_readonly, Enduser_required, Enduser_upd
1085
1086
  preferredPharmacy?: Pharmacy;
1086
1087
  aiSummary?: string;
1087
1088
  aiSummaryUpdatedAt?: Date;
1089
+ aiConversations?: EnduserAIConversation[];
1088
1090
  }
1091
+ export type EnduserAIConversation = {
1092
+ channel: 'SMS';
1093
+ aiConversationId: string;
1094
+ source: string;
1095
+ destination: string;
1096
+ active: boolean;
1097
+ startedAt: Date;
1098
+ endedAt?: Date;
1099
+ endedReason?: string;
1100
+ journeyId?: string;
1101
+ automationStepId?: string;
1102
+ };
1089
1103
  export interface EnduserCustomType_readonly extends ClientRecord {
1090
1104
  }
1091
1105
  export interface EnduserCustomType_required {
@@ -3126,7 +3140,7 @@ export interface WebhookCall {
3126
3140
  integrity: string;
3127
3141
  description?: string;
3128
3142
  }
3129
- export type AutomationEventType = 'onJourneyStart' | 'afterAction' | "formResponse" | "formResponses" | "formUnsubmitted" | "formsUnsubmitted" | "ticketCompleted" | 'waitForTrigger' | "onCallOutcome" | "onAIDecision" | "onError";
3143
+ export type AutomationEventType = 'onJourneyStart' | 'afterAction' | "formResponse" | "formResponses" | "formUnsubmitted" | "formsUnsubmitted" | "ticketCompleted" | 'waitForTrigger' | "onCallOutcome" | "onAIDecision" | "onAIConversationOutcome" | "onError";
3130
3144
  interface AutomationEventBuilder<T extends AutomationEventType, V extends object> {
3131
3145
  type: T;
3132
3146
  info: V;
@@ -3272,6 +3286,10 @@ export type OnAIDecisionAutomationEvent = AutomationEventBuilder<'onAIDecision',
3272
3286
  automationStepId: string;
3273
3287
  outcomes: string[];
3274
3288
  }>;
3289
+ export type OnAIConversationOutcomeAutomationEvent = AutomationEventBuilder<'onAIConversationOutcome', {
3290
+ automationStepId: string;
3291
+ outcome: string;
3292
+ }>;
3275
3293
  export type OnErrorEventInfo = {
3276
3294
  automationStepId: string;
3277
3295
  };
@@ -3287,6 +3305,7 @@ export type AutomationEventForType = {
3287
3305
  'waitForTrigger': WaitForTriggerAutomationEvent;
3288
3306
  'onCallOutcome': OnCallOutcomeAutomationEvent;
3289
3307
  'onAIDecision': OnAIDecisionAutomationEvent;
3308
+ 'onAIConversationOutcome': OnAIConversationOutcomeAutomationEvent;
3290
3309
  'onError': OnErrorAutomationEvent;
3291
3310
  };
3292
3311
  export type AutomationEvent = AutomationEventForType[keyof AutomationEventForType];
@@ -3481,6 +3500,15 @@ export type BelugaAutomationMappingEntry = {
3481
3500
  patientPreferences: BelugaUpdateVisitPatientPreferenceItem[];
3482
3501
  pharmacyId: string;
3483
3502
  };
3503
+ export type BelugaTriggerRefillPatientPreferenceItem = {
3504
+ medId: string;
3505
+ };
3506
+ export type BelugaTriggerRefillAutomationAction = AutomationActionBuilder<'belugaTriggerRefill', {
3507
+ formId: string;
3508
+ patientPreferences?: BelugaTriggerRefillPatientPreferenceItem[];
3509
+ useOrganizationMapping?: boolean;
3510
+ customFieldName?: string;
3511
+ }>;
3484
3512
  export type SendChatAutomationAction = AutomationActionBuilder<'sendChat', {
3485
3513
  templateId: string;
3486
3514
  identifier: string;
@@ -3636,9 +3664,18 @@ export type CreateScriptSureDraftAutomationAction = AutomationActionBuilder<'cre
3636
3664
  matchMedicationTitle?: string;
3637
3665
  matchEnduserState?: boolean;
3638
3666
  }>;
3667
+ export type StartAIConversationActionInfo = AIAgentBaseConfig & {
3668
+ channel: 'SMS';
3669
+ senderId: string;
3670
+ fromNumber?: string;
3671
+ initialMessage: string;
3672
+ inactivityTimeoutHours?: number;
3673
+ };
3674
+ export type StartAIConversationAutomationAction = AutomationActionBuilder<'startAIConversation', StartAIConversationActionInfo>;
3639
3675
  export type AutomationActionForType = {
3640
3676
  'aiDecision': AIDecisionAutomationAction;
3641
3677
  'generateEnduserSummary': GenerateEnduserSummaryAutomationAction;
3678
+ 'startAIConversation': StartAIConversationAutomationAction;
3642
3679
  'assignInboxItem': AssignInboxItemAutomationAction;
3643
3680
  'stripeChargeCardOnFile': StripeChargeCardOnFileAutomationAction;
3644
3681
  'stripeCancelSubscription': StripeCancelSubscriptionAutomationAction;
@@ -3674,6 +3711,7 @@ export type AutomationActionForType = {
3674
3711
  'smartMeterPlaceOrder': SmartMeterPlaceOrderAutomationAction;
3675
3712
  'belugaAutoRx': BelugaAutoRxAutomationAction;
3676
3713
  'belugaUpdateVisit': BelugaUpdateVisitAutomationAction;
3714
+ 'belugaTriggerRefill': BelugaTriggerRefillAutomationAction;
3677
3715
  'healthieSync': HealthieSyncAutomationAction;
3678
3716
  healthieAddToCourse: HealthieAddToCourseAutomationAction;
3679
3717
  healthieSendChat: HealthieSendChatAutomationAction;
@@ -5143,6 +5181,34 @@ export type PhonePlaybackInfo = {
5143
5181
  };
5144
5182
  export type PhonePlaybackType = keyof PhonePlaybackInfo;
5145
5183
  export type PhonePlayback = PhonePlaybackInfo[PhonePlaybackType];
5184
+ export type PhoneTreeAgentToolBuilder<T extends string, V> = {
5185
+ type: T;
5186
+ info: V;
5187
+ };
5188
+ export type PhoneTreeAgentTools = {
5189
+ 'Submit Form': PhoneTreeAgentToolBuilder<'Submit Form', {
5190
+ formId: string;
5191
+ useWhen?: string;
5192
+ }>;
5193
+ 'Book Appointment': PhoneTreeAgentToolBuilder<'Book Appointment', {
5194
+ appointmentBookingPageId: string;
5195
+ useWhen?: string;
5196
+ }>;
5197
+ };
5198
+ export type PhoneTreeAgentToolType = keyof PhoneTreeAgentTools;
5199
+ export type PhoneTreeAgentTool = PhoneTreeAgentTools[PhoneTreeAgentToolType];
5200
+ export type AIAgentBaseConfig = {
5201
+ prompt: string;
5202
+ outcomes: {
5203
+ value: string;
5204
+ description: string;
5205
+ }[];
5206
+ tools?: PhoneTreeAgentTool[];
5207
+ model?: string;
5208
+ maxTokensPerTurn?: number;
5209
+ maxTurns?: number;
5210
+ maxCreditsPerCall?: number;
5211
+ };
5146
5212
  export type PhoneTreeActionBuilder<T, V> = {
5147
5213
  type: T;
5148
5214
  info: V;
@@ -5219,21 +5285,12 @@ export type PhoneTreeActions = {
5219
5285
  'Add to Journey': PhoneTreeActionBuilder<"Add to Journey", {
5220
5286
  journeyId: string;
5221
5287
  }>;
5222
- 'AI Agent': PhoneTreeActionBuilder<"AI Agent", {
5223
- prompt: string;
5288
+ 'AI Agent': PhoneTreeActionBuilder<"AI Agent", AIAgentBaseConfig & {
5224
5289
  greeting?: string;
5225
5290
  voice?: string;
5226
5291
  language?: string;
5227
5292
  interruptible?: boolean;
5228
- maxTokensPerTurn?: number;
5229
- maxTurns?: number;
5230
5293
  maxDurationSeconds?: number;
5231
- maxCreditsPerCall?: number;
5232
- model?: string;
5233
- outcomes: {
5234
- value: string;
5235
- description: string;
5236
- }[];
5237
5294
  }>;
5238
5295
  };
5239
5296
  export type PhoneTreeActionType = keyof PhoneTreeActions;
@@ -6956,6 +7013,7 @@ export type DataSyncRecord = {
6956
7013
  data: 'deleted' | string;
6957
7014
  userIds: string[];
6958
7015
  enduserIds: string[];
7016
+ visibleToAllUsers?: boolean;
6959
7017
  };
6960
7018
  export type InsuranceType = "Primary" | "Secondary";
6961
7019
  export type TwilioQueue = {