@tellescope/types-models 1.255.9 → 1.255.11

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/src/index.ts CHANGED
@@ -1099,6 +1099,12 @@ export interface Enduser extends Enduser_readonly, Enduser_required, Enduser_upd
1099
1099
  pronouns?: string,
1100
1100
  height?: GenericQuantityWithUnit,
1101
1101
  weight?: GenericQuantityWithUnit;
1102
+ dailyCalorieTarget?: number,
1103
+ dailyProteinTarget?: number,
1104
+ dailyCarbTarget?: number,
1105
+ dailyFatTarget?: number,
1106
+ dailyFiberTarget?: number,
1107
+ dailyWaterTarget?: number,
1102
1108
  source?: string,
1103
1109
  usingV1SMS?: boolean, // this was never used in practice, don't use
1104
1110
  addressLineOne?: string,
@@ -2218,6 +2224,7 @@ export interface Form extends Form_readonly, Form_required, Form_updatesDisabled
2218
2224
  syncToCanvasAsDataImport?: boolean,
2219
2225
  matchCareTeamTagsForCanvasPractitionerResolution?: ListOfStringsWithQualifier,
2220
2226
  dontSyncToCanvasOnSubmission?: boolean,
2227
+ dontAssociateCanvasResponsesWithAppointments?: boolean,
2221
2228
  belugaVisitType?: string,
2222
2229
  belugaVerificationId?: string,
2223
2230
  belugaPharmacyMappings?: BelugaPharmacyMapping[],
@@ -3744,6 +3751,15 @@ export type ObservationValue = {
3744
3751
  value: number,
3745
3752
  unit: string,
3746
3753
  }
3754
+ export type ObservationComponentCoding = {
3755
+ system: string,
3756
+ code: string,
3757
+ display?: string,
3758
+ }
3759
+ export type ObservationComponent = {
3760
+ code: { text: string, coding?: ObservationComponentCoding[] },
3761
+ valueQuantity: ObservationValue,
3762
+ }
3747
3763
  // see https://build.fhir.org/valueset-observation-status.html
3748
3764
  export type ObservationStatusCode = (
3749
3765
  'registered'
@@ -3790,6 +3806,7 @@ export interface EnduserObservation extends EnduserObservation_readonly, Enduser
3790
3806
  showWithPlotsByUnit?: string[],
3791
3807
  invalidationReason?: string,
3792
3808
  excludeFromVitalCountLookback?: boolean,
3809
+ components?: ObservationComponent[],
3793
3810
  }
3794
3811
 
3795
3812
  export type BlockType = 'h1' | 'h2' | 'html' | 'raw-html' | 'image' | 'youtube' | 'pdf' | 'iframe' | 'content-link'
@@ -5055,6 +5072,8 @@ export type PhoneTreeEvents = {
5055
5072
  'If No Users Match': PhoneTreeEventBuilder<'If No Users Match', { }>,
5056
5073
  'If No Users Answer': PhoneTreeEventBuilder<'If No Users Answer', { }>,
5057
5074
  'After Action': PhoneTreeEventBuilder<'After Action', { }>,
5075
+ // branches from an 'AI Agent' node when the agent ends with this outcome (the AI sibling of 'On Gather')
5076
+ 'On Agent Outcome': PhoneTreeEventBuilder<'On Agent Outcome', { outcome: string }>,
5058
5077
  }
5059
5078
  export type PhoneTreeEventType = keyof PhoneTreeEvents
5060
5079
  export type PhoneTreeEvent = PhoneTreeEvents[PhoneTreeEventType]
@@ -5111,8 +5130,23 @@ export type PhoneTreeActions = {
5111
5130
  playback?: Partial<PhonePlayback>,
5112
5131
  }>
5113
5132
  'Add to Journey': PhoneTreeActionBuilder<"Add to Journey", { journeyId: string }>
5133
+ // Conversational AI agent (Twilio ConversationRelay + Bedrock). A generic "end call with outcome"
5134
+ // step: the agent converses, then ends with one of the configured outcomes; the tree branches on
5135
+ // the outcome via 'On Agent Outcome' events, like 'On Gather' branches on input.
5136
+ 'AI Agent': PhoneTreeActionBuilder<"AI Agent", {
5137
+ prompt: string, // org-authored additions to the base voice system prompt
5138
+ greeting?: string, // ConversationRelay welcomeGreeting
5139
+ voice?: string,
5140
+ language?: string,
5141
+ interruptible?: boolean, // barge-in, default true
5142
+ maxTokensPerTurn?: number,
5143
+ maxTurns?: number,
5144
+ maxDurationSeconds?: number,
5145
+ maxCreditsPerCall?: number, // per-call spend circuit breaker, default from constants
5146
+ outcomes: { value: string, description: string }[], // the agent must end with one of these
5147
+ }>
5114
5148
  }
5115
- export type PhoneTreeActionType = keyof PhoneTreeActions
5149
+ export type PhoneTreeActionType = keyof PhoneTreeActions
5116
5150
  export type PhoneTreeAction = PhoneTreeActions[PhoneTreeActionType]
5117
5151
 
5118
5152
  export type PhoneTreeNode = {
@@ -5674,6 +5708,10 @@ export type AICOnversationMessageContent = {
5674
5708
  type: 'text' | 'image' | 'file',
5675
5709
  text?: string,
5676
5710
  }
5711
+ // Status of a metered (voice agent) Bedrock invocation. A pair of messages that stays
5712
+ // 'pending' permanently is the durable record of a crashed invocation (never rated/charged).
5713
+ export type AIConversationMessageStatus =
5714
+ 'pending' | 'completed' | 'errored_pre_stream' | 'errored_mid_stream' | 'rejected_pre_request'
5677
5715
  export type AIConversationMessage = {
5678
5716
  role: 'user' | 'assistant',
5679
5717
  text: string,
@@ -5682,6 +5720,20 @@ export type AIConversationMessage = {
5682
5720
  content?: AICOnversationMessageContent[],
5683
5721
  userId?: string, // for user messages
5684
5722
  systemPrompt?: string, // system prompt used for this API call (typically on last input message)
5723
+ // metering fields (voice agent) — all optional; existing chat messages are unaffected.
5724
+ // Voice-agent entries are content-free (text: '') and exist for billing/audit only.
5725
+ invocationId?: string, // UUID minted before the Bedrock call; shared by the user/assistant pair — idempotency key
5726
+ turnId?: string, // shared by all invocations of one tool-loop turn
5727
+ toolRound?: number, // 0 for the first invocation of a turn; increments per tool-loop round
5728
+ status?: AIConversationMessageStatus,
5729
+ estimated?: boolean, // true when usage metadata never arrived and tokens are a conservative estimate
5730
+ stopReason?: string,
5731
+ interrupted?: boolean, // barge-in / hangup mid-stream (usage still authoritative via drain)
5732
+ latencyMs?: number,
5733
+ cacheReadInputTokens?: number, // captured from day one, default 0 (assistant entry)
5734
+ cacheWriteInputTokens?: number,
5735
+ ratedAt?: Date, // set once when credits were deducted for this pair (assistant entry)
5736
+ creditsCharged?: number, // credits actually deducted (assistant entry) — raw tokens above are never rewritten
5685
5737
  }
5686
5738
  export interface AIConversation_readonly extends ClientRecord {}
5687
5739
  export interface AIConversation_required {
@@ -5695,6 +5747,9 @@ export interface AIConversation extends AIConversation_readonly, AIConversation_
5695
5747
  enduserId?: string, // optional patient this conversation is about (e.g. AI patient summaries / decisions)
5696
5748
  journeyId?: string, // optional journey that produced this conversation (audit trail)
5697
5749
  automationStepId?: string, // optional automation step that produced this conversation (audit trail)
5750
+ callSid?: string, // voice agent: the Twilio call this usage-only conversation belongs to
5751
+ phoneTreeId?: string, // voice agent: tree containing the AI Agent node
5752
+ nodeId?: string, // voice agent: the AI Agent node id
5698
5753
  }
5699
5754
 
5700
5755
  export interface InboxThread_readonly extends ClientRecord {