twilio-agent-connect 2.4.0 → 2.5.0

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/README.md CHANGED
@@ -38,6 +38,7 @@ Seamlessly integrate with Twilio Conversation Memory and Conversation Orchestrat
38
38
  ## Key Features
39
39
 
40
40
  - **Multi-Channel Support**: Built-in handling for Voice (ConversationRelay), SMS, RCS, WhatsApp, and Chat
41
+ - **Multi-Sender Support**: Configure multiple phone numbers, RCS Sender IDs, or WhatsApp numbers per channel by setting the comma-separated plural env var (`TWILIO_PHONE_NUMBERS`, `TWILIO_RCS_SENDER_IDS`, `TWILIO_WHATSAPP_NUMBERS`) instead of the singular one; the first entry is the default sender for outbound
41
42
  - **Outbound Conversations**: Agent-initiated conversations across all supported channels
42
43
  - **ConversationRelay-Only Mode**: Get started quickly with TAC's voice plumbing (TwiML, WebSocket, callbacks) before adding Conversation Orchestrator or Conversation Memory
43
44
  - **Memory Management**: Automatic integration with Twilio Conversation Memory for persistent user context
@@ -56,12 +57,13 @@ npm install twilio-agent-connect
56
57
 
57
58
  **Option 1: Use the Setup Wizard**
58
59
 
59
- Use the [Twilio Setup Wizard](https://github.com/twilio/twilio-agent-connect-python/tree/main/getting_started/twilio_setup) from the Python SDK to automatically create a Memory Store and Conversation Configuration and generate your `.env` file:
60
+ Use the [Twilio Setup Wizard](getting_started/twilio-setup/) to automatically create a Memory Store and Conversation Configuration and generate your `.env` file:
60
61
 
61
62
  ```bash
62
- git clone https://github.com/twilio/twilio-agent-connect-python.git
63
- cd twilio-agent-connect-python
64
- make setup # Open http://localhost:8080
63
+ git clone https://github.com/twilio/twilio-agent-connect-typescript.git
64
+ cd twilio-agent-connect-typescript
65
+ npm install
66
+ npm run setup # Open http://localhost:8080
65
67
  ```
66
68
 
67
69
  **Option 2: Manual Setup**
@@ -107,10 +109,6 @@ const tac = await TAC.create({ config: TACConfig.fromEnv() });
107
109
  const voiceChannel = new VoiceChannel(tac);
108
110
  const smsChannel = new SMSChannel(tac);
109
111
 
110
- // Register channels
111
- tac.registerChannel(voiceChannel);
112
- tac.registerChannel(smsChannel);
113
-
114
112
  // Store conversation history
115
113
  const conversationHistory: Record<string, OpenAI.Chat.ChatCompletionMessageParam[]> = {};
116
114
 
@@ -148,7 +146,7 @@ tac.onMessageReady(async ({ conversationId, message, memory, session }) => {
148
146
  return llmResponse;
149
147
  });
150
148
 
151
- const server = new TACServer(tac);
149
+ const server = new TACServer(tac, { voiceChannel, messagingChannels: [smsChannel] });
152
150
  await server.start();
153
151
  ```
154
152
 
@@ -193,6 +191,7 @@ TAC_ANALYTICS_DISABLED=true
193
191
  **Examples & Guides:**
194
192
  - **[API Reference](https://twilio.github.io/twilio-agent-connect-typescript/)** - Full API documentation generated from the source
195
193
  - **[Getting Started Guide](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/)** - Examples and comprehensive documentation
194
+ - **[Twilio Setup Wizard](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/twilio-setup/)** - Create your Memory Store and Conversation Configuration from a local web UI
196
195
  - **[OpenAI SDK Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/openai/)** - Complete multi-channel example with Voice, SMS, and Chat
197
196
  - **[WhatsApp Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/whatsapp/)** - WhatsApp channel with memory integration
198
197
  - **[Chat Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/chat/)** - Web chat integration example
package/dist/index.d.ts CHANGED
@@ -44,14 +44,17 @@ declare const CALL_EVENT_KINDS: readonly CallEventKind[];
44
44
  /**
45
45
  * TAC configuration schema
46
46
  */
47
- declare const TACConfigSchema: z.ZodObject<{
47
+ declare const TACConfigSchema: z.ZodPipe<z.ZodObject<{
48
48
  accountSid: z.ZodString;
49
49
  authToken: z.ZodString;
50
50
  apiKey: z.ZodString;
51
51
  apiSecret: z.ZodString;
52
- phoneNumber: z.ZodString;
52
+ phoneNumber: z.ZodOptional<z.ZodString>;
53
+ phoneNumbers: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
54
  rcsSenderId: z.ZodOptional<z.ZodString>;
55
+ rcsSenderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
56
  whatsappNumber: z.ZodOptional<z.ZodString>;
57
+ whatsappNumbers: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
58
  memoryConfig: z.ZodPrefault<z.ZodObject<{
56
59
  traitGroups: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
60
  observationsLimit: z.ZodDefault<z.ZodNumber>;
@@ -63,14 +66,82 @@ declare const TACConfigSchema: z.ZodObject<{
63
66
  }, z.core.$strip>>;
64
67
  conversationConfigurationId: z.ZodOptional<z.ZodString>;
65
68
  voicePublicDomain: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
66
- voiceWebsocketPath: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
67
- voiceActionPath: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
68
- voiceCallEventPath: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
69
+ voiceWebsocketPath: z.ZodPreprocess<z.ZodDefault<z.ZodString>>;
70
+ voiceActionPath: z.ZodPreprocess<z.ZodDefault<z.ZodString>>;
71
+ voiceCallEventPath: z.ZodPreprocess<z.ZodDefault<z.ZodString>>;
69
72
  cintelConfigurationId: z.ZodOptional<z.ZodString>;
70
73
  cintelSummaryOperatorSid: z.ZodOptional<z.ZodString>;
71
74
  region: z.ZodOptional<z.ZodString>;
72
75
  studioHandoffFlowSid: z.ZodOptional<z.ZodString>;
73
- }, z.core.$strip>;
76
+ }, z.core.$strip>, z.ZodTransform<{
77
+ phoneNumber: string;
78
+ phoneNumbers: string[];
79
+ rcsSenderId: string | undefined;
80
+ rcsSenderIds: string[];
81
+ whatsappNumber: string | undefined;
82
+ whatsappNumbers: string[];
83
+ accountSid: string;
84
+ authToken: string;
85
+ apiKey: string;
86
+ apiSecret: string;
87
+ memoryConfig: {
88
+ observationsLimit: number;
89
+ summariesLimit: number;
90
+ communicationsLimit: number;
91
+ relevanceThreshold: number;
92
+ phoneTraitGroup: string;
93
+ phoneTraitField: string;
94
+ traitGroups?: string[] | undefined;
95
+ };
96
+ voiceWebsocketPath: string;
97
+ voiceActionPath: string;
98
+ voiceCallEventPath: string;
99
+ conversationConfigurationId?: string | undefined;
100
+ voicePublicDomain?: string | undefined;
101
+ cintelConfigurationId?: string | undefined;
102
+ cintelSummaryOperatorSid?: string | undefined;
103
+ region?: string | undefined;
104
+ studioHandoffFlowSid?: string | undefined;
105
+ }, {
106
+ accountSid: string;
107
+ authToken: string;
108
+ apiKey: string;
109
+ apiSecret: string;
110
+ memoryConfig: {
111
+ observationsLimit: number;
112
+ summariesLimit: number;
113
+ communicationsLimit: number;
114
+ relevanceThreshold: number;
115
+ phoneTraitGroup: string;
116
+ phoneTraitField: string;
117
+ traitGroups?: string[] | undefined;
118
+ };
119
+ voiceWebsocketPath: string;
120
+ voiceActionPath: string;
121
+ voiceCallEventPath: string;
122
+ phoneNumber?: string | undefined;
123
+ phoneNumbers?: string[] | undefined;
124
+ rcsSenderId?: string | undefined;
125
+ rcsSenderIds?: string[] | undefined;
126
+ whatsappNumber?: string | undefined;
127
+ whatsappNumbers?: string[] | undefined;
128
+ conversationConfigurationId?: string | undefined;
129
+ voicePublicDomain?: string | undefined;
130
+ cintelConfigurationId?: string | undefined;
131
+ cintelSummaryOperatorSid?: string | undefined;
132
+ region?: string | undefined;
133
+ studioHandoffFlowSid?: string | undefined;
134
+ }>>;
135
+ /**
136
+ * Raw TAC configuration accepted by `new TACConfig()` and `TACOptions.config`.
137
+ * Fields the schema back-fills or defaults (e.g. `phoneNumbers`, `memoryConfig`)
138
+ * are optional here.
139
+ */
140
+ type TACConfigInput = z.input<typeof TACConfigSchema>;
141
+ /**
142
+ * Normalized TAC configuration produced by validating a {@link TACConfigInput}:
143
+ * defaults applied and each sender pair back-filled (default first, de-duplicated).
144
+ */
74
145
  type TACConfigData = z.infer<typeof TACConfigSchema>;
75
146
  /**
76
147
  * Environment variable mapping for configuration
@@ -81,8 +152,11 @@ declare const EnvironmentVariables: {
81
152
  readonly TWILIO_API_KEY: "TWILIO_API_KEY";
82
153
  readonly TWILIO_API_SECRET: "TWILIO_API_SECRET";
83
154
  readonly TWILIO_PHONE_NUMBER: "TWILIO_PHONE_NUMBER";
155
+ readonly TWILIO_PHONE_NUMBERS: "TWILIO_PHONE_NUMBERS";
84
156
  readonly TWILIO_RCS_SENDER_ID: "TWILIO_RCS_SENDER_ID";
157
+ readonly TWILIO_RCS_SENDER_IDS: "TWILIO_RCS_SENDER_IDS";
85
158
  readonly TWILIO_WHATSAPP_NUMBER: "TWILIO_WHATSAPP_NUMBER";
159
+ readonly TWILIO_WHATSAPP_NUMBERS: "TWILIO_WHATSAPP_NUMBERS";
86
160
  readonly TWILIO_MEMORY_PROFILE_TRAIT_GROUPS: "TWILIO_MEMORY_PROFILE_TRAIT_GROUPS";
87
161
  readonly TWILIO_MEMORY_OBSERVATIONS_LIMIT: "TWILIO_MEMORY_OBSERVATIONS_LIMIT";
88
162
  readonly TWILIO_MEMORY_SUMMARIES_LIMIT: "TWILIO_MEMORY_SUMMARIES_LIMIT";
@@ -1463,16 +1537,18 @@ declare const ConversationConfigurationSchema: z.ZodObject<{
1463
1537
  }, z.core.$strip>;
1464
1538
  type ConversationConfiguration = z.infer<typeof ConversationConfigurationSchema>;
1465
1539
  /**
1466
- * Options for initiating an outbound SMS conversation.
1540
+ * Options for initiating an outbound messaging conversation (SMS/RCS/WhatsApp).
1467
1541
  *
1468
- * The sender is always TAC's configured `config.phoneNumber`. Multi-sender
1469
- * deployments should run one TAC instance per sender so inbound webhook
1470
- * routing, memory scoping, and configuration stay in sync.
1542
+ * The sender defaults to the channel's configured default (`config.phoneNumber`
1543
+ * for SMS, `config.rcsSenderId` for RCS, `config.whatsappNumber` for WhatsApp).
1544
+ * Set `from` to send from any other configured sender for that channel
1545
+ * (`config.phoneNumbers` / `rcsSenderIds` / `whatsappNumbers`).
1471
1546
  */
1472
1547
  declare const InitiateMessagingConversationOptionsSchema: z.ZodObject<{
1473
1548
  to: z.ZodString;
1474
1549
  message: z.ZodString;
1475
1550
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1551
+ from: z.ZodOptional<z.ZodString>;
1476
1552
  }, z.core.$strip>;
1477
1553
  type InitiateMessagingConversationOptions = z.infer<typeof InitiateMessagingConversationOptionsSchema>;
1478
1554
  /**
@@ -2224,8 +2300,8 @@ declare function callOptionsToCreateParams(options: CallOptions): Record<string,
2224
2300
  /**
2225
2301
  * Options for initiating an outbound voice conversation.
2226
2302
  *
2227
- * The caller identity is always TAC's configured `config.phoneNumber`.
2228
- * Multi-number deployments should run one TAC instance per line.
2303
+ * The caller identity is TAC's configured `config.phoneNumber` by default, or
2304
+ * `from` when set to one of `config.phoneNumbers`.
2229
2305
  *
2230
2306
  * TwiML for the outbound call is built by merging per-field, highest precedence
2231
2307
  * first:
@@ -2241,6 +2317,11 @@ declare function callOptionsToCreateParams(options: CallOptions): Record<string,
2241
2317
  */
2242
2318
  interface InitiateVoiceConversationOptions {
2243
2319
  to: string;
2320
+ /**
2321
+ * Phone number to place the call from. Must be one of `config.phoneNumbers`.
2322
+ * When omitted, `config.phoneNumber` (the default sender) is used.
2323
+ */
2324
+ from?: string | undefined;
2244
2325
  /**
2245
2326
  * Public WebSocket URL for ConversationRelay (e.g. 'wss://your-domain.ngrok.app/ws').
2246
2327
  * Optional — defaults to the URL derived from `TACConfig.voicePublicDomain` +
@@ -2284,6 +2365,7 @@ declare const InitiateVoiceConversationOptionsSchema: z.ZodType<InitiateVoiceCon
2284
2365
  */
2285
2366
  declare const InitiateVoiceConversationOptionsOpenAIRealtimeSchema: z.ZodObject<{
2286
2367
  to: z.ZodString;
2368
+ from: z.ZodOptional<z.ZodString>;
2287
2369
  websocketUrl: z.ZodOptional<z.ZodURL>;
2288
2370
  callOptions: z.ZodOptional<z.ZodType<CallOptions, unknown, z.core.$ZodTypeInternals<CallOptions, unknown>>>;
2289
2371
  twimlOptions: z.ZodOptional<z.ZodObject<{
@@ -2313,6 +2395,7 @@ type InitiateVoiceConversationOptionsOpenAIRealtime = z.infer<typeof InitiateVoi
2313
2395
  */
2314
2396
  declare const InitiateVoiceConversationOptionsGPTLiveSchema: z.ZodObject<{
2315
2397
  to: z.ZodString;
2398
+ from: z.ZodOptional<z.ZodString>;
2316
2399
  websocketUrl: z.ZodOptional<z.ZodURL>;
2317
2400
  callOptions: z.ZodOptional<z.ZodType<CallOptions, unknown, z.core.$ZodTypeInternals<CallOptions, unknown>>>;
2318
2401
  twimlOptions: z.ZodOptional<z.ZodObject<{
@@ -2708,9 +2791,24 @@ declare class TACConfig {
2708
2791
  readonly authToken: string;
2709
2792
  readonly apiKey: string;
2710
2793
  readonly apiSecret: string;
2794
+ /**
2795
+ * Default Twilio phone number for Voice and SMS — the sender used for
2796
+ * outbound when a call does not specify `from`. Always populated and always a
2797
+ * member of {@link phoneNumbers}.
2798
+ */
2711
2799
  readonly phoneNumber: string;
2800
+ /**
2801
+ * Full set of Twilio phone numbers this instance serves for Voice and SMS
2802
+ * (the inbound allowlist). Always includes {@link phoneNumber} as the first,
2803
+ * default sender.
2804
+ */
2805
+ readonly phoneNumbers: string[];
2712
2806
  readonly rcsSenderId?: string;
2807
+ /** Full set of RCS Sender IDs this instance serves; the default is first. */
2808
+ readonly rcsSenderIds: string[];
2713
2809
  readonly whatsappNumber?: string;
2810
+ /** Full set of WhatsApp numbers this instance serves; the default is first. */
2811
+ readonly whatsappNumbers: string[];
2714
2812
  readonly memoryConfig: TACConfigData['memoryConfig'];
2715
2813
  readonly conversationConfigurationId?: string;
2716
2814
  readonly voicePublicDomain?: string;
@@ -2732,7 +2830,7 @@ declare class TACConfig {
2732
2830
  * from this SID.
2733
2831
  */
2734
2832
  readonly studioHandoffFlowSid?: string;
2735
- constructor(data: TACConfigData | z.input<typeof TACConfigSchema>);
2833
+ constructor(data: TACConfigInput);
2736
2834
  /**
2737
2835
  * Create TACConfig from environment variables.
2738
2836
  *
@@ -2741,10 +2839,13 @@ declare class TACConfig {
2741
2839
  * - TWILIO_AUTH_TOKEN: Twilio Auth Token for API authentication
2742
2840
  * - TWILIO_API_KEY: Twilio API Key SID (starts with SK)
2743
2841
  * - TWILIO_API_SECRET: Twilio API Secret for API Key authentication
2744
- * - TWILIO_PHONE_NUMBER: Phone number for voice and SMS channels
2842
+ * - TWILIO_PHONE_NUMBER and/or TWILIO_PHONE_NUMBERS: at least one is required.
2843
+ * Phone number(s) for voice and SMS channels — see **Multi-Value Senders** below.
2745
2844
  *
2746
2845
  * Optional environment variables:
2747
- * - TWILIO_WHATSAPP_NUMBER: WhatsApp number for WhatsApp channel (e.g., 'whatsapp:+1234567890')
2846
+ * - TWILIO_WHATSAPP_NUMBER / TWILIO_WHATSAPP_NUMBERS: WhatsApp number(s) for the
2847
+ * WhatsApp channel (e.g., 'whatsapp:+1234567890')
2848
+ * - TWILIO_RCS_SENDER_ID / TWILIO_RCS_SENDER_IDS: RCS Sender ID(s) for the RCS channel
2748
2849
  * - TWILIO_CONVERSATION_CONFIGURATION_ID: Conversation Orchestrator configuration ID (enables orchestrated mode)
2749
2850
  * - TWILIO_VOICE_PUBLIC_DOMAIN: Public domain for voice routes (required for voice; a port and/or base path are allowed, e.g., 'abc123.ngrok.app', 'example.ngrok.app:8080', or 'example.com/server1')
2750
2851
  * - TWILIO_VOICE_WEBSOCKET_PATH: Path for the voice WebSocket (default: /ws)
@@ -2752,7 +2853,16 @@ declare class TACConfig {
2752
2853
  * - TWILIO_VOICE_CALL_EVENT_PATH: Base path for the call-event callbacks — status, async AMD, recording (default: /twilio/call-events)
2753
2854
  * - TWILIO_REGION: Twilio region subdomain for API routing (e.g. transforms base URLs to `https://{product}.{region}.twilio.com`)
2754
2855
  * - TWILIO_STUDIO_HANDOFF_FLOW_SID: Studio Flow SID used by createStudioHandoffTool for human handoff
2755
- * - TWILIO_RCS_SENDER_ID: RCS Sender ID for the RCS channel
2856
+ *
2857
+ * Multi-Value Senders:
2858
+ * - Each singular env var (TWILIO_PHONE_NUMBER, TWILIO_RCS_SENDER_ID,
2859
+ * TWILIO_WHATSAPP_NUMBER) pairs with a plural, comma-separated one
2860
+ * (TWILIO_PHONE_NUMBERS, TWILIO_RCS_SENDER_IDS, TWILIO_WHATSAPP_NUMBERS),
2861
+ * e.g. `TWILIO_PHONE_NUMBERS=+1555,+1444`. Whichever side is set back-fills
2862
+ * the other: the singular becomes the default sender and the plural the full
2863
+ * allowlist. Entries are whitespace-trimmed and de-duplicated, with the
2864
+ * default kept first. `phoneNumber` requires at least one of the two; the RCS
2865
+ * and WhatsApp pairs stay optional.
2756
2866
  *
2757
2867
  * Memory Configuration (defaults defined in TwilioMemoryConfigSchema):
2758
2868
  * - TWILIO_MEMORY_PROFILE_TRAIT_GROUPS: Trait groups to include (comma-separated, e.g., "Contact,Preferences")
@@ -3147,6 +3257,17 @@ declare abstract class BaseChannel {
3147
3257
  * Get the channel type (implemented by subclasses)
3148
3258
  */
3149
3259
  abstract get channelType(): ChannelType;
3260
+ /**
3261
+ * Resolve the outbound sender address for this channel.
3262
+ *
3263
+ * `requested` (the caller's `options.from`) wins when it is one of the
3264
+ * channel's configured senders; otherwise throws. When omitted, the channel
3265
+ * default is used.
3266
+ */
3267
+ protected resolveOutboundFrom(requested: string | undefined, options: {
3268
+ allowlist: string[];
3269
+ default: string | undefined;
3270
+ }): string;
3150
3271
  /**
3151
3272
  * Register event callbacks
3152
3273
  */
@@ -3272,7 +3393,7 @@ declare abstract class BaseChannel {
3272
3393
  }
3273
3394
 
3274
3395
  interface TACOptions {
3275
- config?: TACConfig | TACConfigData;
3396
+ config?: TACConfig | TACConfigInput;
3276
3397
  logger?: Logger;
3277
3398
  }
3278
3399
  /**
@@ -3288,10 +3409,24 @@ type MessageReadyCallback = (params: {
3288
3409
  channel: ChannelType;
3289
3410
  abortSignal?: AbortSignal;
3290
3411
  }) => Promise<string | null | void> | string | null | void;
3412
+ /**
3413
+ * Callback registered with {@link TAC.onInterrupt}, invoked when the caller
3414
+ * interrupts the agent on a voice call.
3415
+ */
3291
3416
  type InterruptCallback = (params: {
3417
+ /** The interrupted conversation. */
3292
3418
  conversationId: ConversationId;
3419
+ /**
3420
+ * Text the agent had spoken when interrupted. `undefined` if
3421
+ * ConversationRelay doesn't report it.
3422
+ */
3293
3423
  utteranceUntilInterrupt: string | undefined;
3424
+ /**
3425
+ * How long the agent had been speaking, in milliseconds. `undefined` if
3426
+ * ConversationRelay doesn't report it.
3427
+ */
3294
3428
  durationUntilInterruptMs: number | undefined;
3429
+ /** The live session for the call. */
3295
3430
  session: ConversationSession;
3296
3431
  }) => Promise<void> | void;
3297
3432
  type ConversationEndedCallback = (params: {
@@ -3319,7 +3454,16 @@ declare class TAC {
3319
3454
  private constructor();
3320
3455
  static create(options?: TACOptions): Promise<TAC>;
3321
3456
  /**
3322
- * Register a channel with the framework
3457
+ * Register a channel with the framework, routing its inbound messages to the
3458
+ * {@link TAC.onMessageReady} callback and shutting it down with {@link TAC.shutdown}.
3459
+ *
3460
+ * `TACServer` registers the channels passed to it (`voiceChannel` /
3461
+ * `messagingChannels`), so you only need this when wiring channels into your
3462
+ * own web framework instead of `TACServer`.
3463
+ *
3464
+ * Only one channel per type is registered: registering a different instance
3465
+ * of the same type shuts down and replaces the existing one. Registering the
3466
+ * same instance again is a no-op.
3323
3467
  */
3324
3468
  registerChannel(channel: BaseChannel): void;
3325
3469
  /**
@@ -3336,7 +3480,24 @@ declare class TAC {
3336
3480
  */
3337
3481
  onMessageReady(callback: MessageReadyCallback): void;
3338
3482
  /**
3339
- * Register callback for when user interrupts (voice channel)
3483
+ * Register callback invoked when the caller interrupts the agent on a voice call.
3484
+ *
3485
+ * Currently fired by the ConversationRelay voice provider. The callback receives
3486
+ * `conversationId`, the call's `session`, `utteranceUntilInterrupt` (the text the
3487
+ * agent had spoken when interrupted) and `durationUntilInterruptMs` (how long it
3488
+ * had been speaking); either of the last two may be `undefined` if
3489
+ * ConversationRelay doesn't report it. Errors thrown by the callback are logged,
3490
+ * not rethrown.
3491
+ *
3492
+ * @example
3493
+ * ```typescript
3494
+ * tac.onInterrupt(({ conversationId, utteranceUntilInterrupt, durationUntilInterruptMs }) => {
3495
+ * console.log(
3496
+ * `${conversationId} interrupted after ${durationUntilInterruptMs} ms: ` +
3497
+ * JSON.stringify(utteranceUntilInterrupt)
3498
+ * );
3499
+ * });
3500
+ * ```
3340
3501
  */
3341
3502
  onInterrupt(callback: InterruptCallback): void;
3342
3503
  /**
@@ -3479,6 +3640,12 @@ interface MessagingChannelEvents extends BaseChannelEvents {
3479
3640
  * promote a channel-matching UNKNOWN participant (not owning the agent
3480
3641
  * address) to CUSTOMER. Set `false` for channels where the customer is
3481
3642
  * identified author-driven (e.g. chat).
3643
+ * - `deriveInboundAgentFromRecipients`: if `true` (default), the inbound agent
3644
+ * address is derived from the webhook's recipient (which of TAC's configured
3645
+ * numbers was messaged), validated against the channel's allowlist. `true` for
3646
+ * phone-like channels (SMS, RCS, WhatsApp). Set `false` for channels where the
3647
+ * agent is a single identity rather than a number set (e.g. chat), which keeps
3648
+ * the default-address path instead.
3482
3649
  */
3483
3650
  declare abstract class MessagingChannel extends BaseChannel {
3484
3651
  protected readonly conversationClient: ConversationClient;
@@ -3488,10 +3655,25 @@ declare abstract class MessagingChannel extends BaseChannel {
3488
3655
  * participant to CUSTOMER. Subclasses override to opt out (e.g. chat).
3489
3656
  */
3490
3657
  protected reconcileCustomerType: boolean;
3658
+ /**
3659
+ * Phone-like channels derive the agent address from the inbound webhook's
3660
+ * recipient (which of TAC's numbers was messaged). Chat uses a single identity
3661
+ * and opts out, keeping the default-address path.
3662
+ */
3663
+ protected deriveInboundAgentFromRecipients: boolean;
3664
+ /**
3665
+ * The uppercase Conversation Orchestrator channel name for this channel (e.g.
3666
+ * `"SMS"`, `"RCS"`), used to filter webhook recipients and participant
3667
+ * addresses. Derived from {@link channelType}.
3668
+ */
3669
+ protected getChannelName(): ParticipantAddressType;
3491
3670
  constructor(tac: TAC, config?: MessagingChannelConfig);
3492
3671
  /**
3493
- * Fast-path check: is the author address this channel's default agent address?
3494
- * (e.g., config.phoneNumber for SMS, agentAddress for Chat)
3672
+ * Fast-path check: is the author address one of this channel's configured agent addresses?
3673
+ *
3674
+ * Checks the channel's full sender allowlist, not just the default sender:
3675
+ * `config.phoneNumbers` for SMS, `config.rcsSenderIds` for RCS,
3676
+ * `config.whatsappNumbers` for WhatsApp, and `agentAddress` for Chat.
3495
3677
  */
3496
3678
  protected abstract isDefaultAgentAddress(authorAddress: string): boolean;
3497
3679
  /**
@@ -3570,12 +3752,23 @@ declare abstract class MessagingChannel extends BaseChannel {
3570
3752
  * (via `session.authorInfo.participantId`), so promoting some other
3571
3753
  * `UNKNOWN` CHAT participant could pick the wrong recipient.
3572
3754
  *
3755
+ * @param agentAddress - The agent address for this conversation, normally
3756
+ * derived from the inbound webhook's recipient. When omitted, it is resolved
3757
+ * from a participant scan (phone-like channels) or the channel default.
3573
3758
  * @returns `[agent, customerOrNull]` on success. `customer` is `null` when
3574
3759
  * `reconcileCustomerType` is `false`. `null` overall when either the agent
3575
3760
  * or the customer cannot be resolved — the caller treats `null` as a hard
3576
3761
  * stop and skips the message-ready callback.
3577
3762
  */
3578
- protected reconcileParticipants(conversationId: ConversationId): Promise<[ConversationParticipant, ConversationParticipant | null] | null>;
3763
+ protected reconcileParticipants(conversationId: ConversationId, agentAddress?: ConversationAddress): Promise<[ConversationParticipant, ConversationParticipant | null] | null>;
3764
+ /**
3765
+ * Resolve the agent address when the inbound webhook carried no recipient.
3766
+ *
3767
+ * Scans the conversation's participants for any of TAC's configured addresses
3768
+ * on this channel; falls back to the channel default when none is present.
3769
+ * Defensive path — the primary source is the webhook.
3770
+ */
3771
+ protected fallbackAgentAddress(conversationId: ConversationId, participants: ConversationParticipant[], channel: ParticipantAddressType): ConversationAddress;
3579
3772
  /**
3580
3773
  * Find or mint a Conversation Memory profile for a customer being promoted from UNKNOWN.
3581
3774
  *
@@ -3653,7 +3846,8 @@ declare class SMSChannel extends MessagingChannel {
3653
3846
  *
3654
3847
  * Creates a conversation via Conversation Orchestrator, adds customer and
3655
3848
  * agent participants, then sends the initial message via the Actions API.
3656
- * The sender is always `config.phoneNumber`.
3849
+ * Uses `options.from` when provided (must be one of the configured phone
3850
+ * numbers), otherwise falls back to the default `config.phoneNumber`.
3657
3851
  */
3658
3852
  initiateOutboundConversation(options: InitiateMessagingConversationOptions): Promise<InitiateConversationResult>;
3659
3853
  }
@@ -3686,7 +3880,8 @@ declare class RCSChannel extends MessagingChannel {
3686
3880
  *
3687
3881
  * Creates a conversation via Conversation Orchestrator, adds customer and
3688
3882
  * agent participants, then sends the initial message via the Actions API.
3689
- * The sender is always `config.rcsSenderId`.
3883
+ * Uses `options.from` when provided (must be one of the configured RCS
3884
+ * senders), otherwise falls back to the default `config.rcsSenderId`.
3690
3885
  */
3691
3886
  initiateOutboundConversation(options: InitiateMessagingConversationOptions): Promise<InitiateConversationResult>;
3692
3887
  }
@@ -3701,6 +3896,7 @@ declare class RCSChannel extends MessagingChannel {
3701
3896
  * (via TWILIO_WHATSAPP_NUMBER). Address format: whatsapp:+1234567890
3702
3897
  */
3703
3898
  declare class WhatsAppChannel extends MessagingChannel {
3899
+ constructor(tac: TAC, config?: MessagingChannelConfig);
3704
3900
  get channelType(): ChannelType;
3705
3901
  protected isDefaultAgentAddress(authorAddress: string): boolean;
3706
3902
  protected getAgentAddress(_conversationId: ConversationId): ConversationAddress;
@@ -3719,7 +3915,8 @@ declare class WhatsAppChannel extends MessagingChannel {
3719
3915
  *
3720
3916
  * Creates a conversation via Conversation Orchestrator, adds customer and
3721
3917
  * agent participants, then sends the initial message via the Actions API.
3722
- * The sender is always `config.whatsappNumber`.
3918
+ * Uses `options.from` when provided (must be one of the configured WhatsApp
3919
+ * numbers), otherwise falls back to the default `config.whatsappNumber`.
3723
3920
  */
3724
3921
  initiateOutboundConversation(options: InitiateMessagingConversationOptions): Promise<InitiateConversationResult>;
3725
3922
  }
@@ -3754,6 +3951,7 @@ interface ChatChannelConfig extends MessagingChannelConfig {
3754
3951
  declare class ChatChannel extends MessagingChannel {
3755
3952
  private readonly agentAddress;
3756
3953
  protected reconcileCustomerType: boolean;
3954
+ protected deriveInboundAgentFromRecipients: boolean;
3757
3955
  constructor(tac: TAC, config?: ChatChannelConfig);
3758
3956
  get channelType(): ChannelType;
3759
3957
  protected isDefaultAgentAddress(authorAddress: string): boolean;
@@ -3882,6 +4080,14 @@ declare class VoiceProvider {
3882
4080
  * never overwritten.
3883
4081
  */
3884
4082
  protected applyCallEventCallbacks(callParams: Record<string, unknown>): Record<string, unknown>;
4083
+ /**
4084
+ * Resolve the outbound caller ID for a voice call.
4085
+ *
4086
+ * Validates `requested` against `config.phoneNumbers`, defaulting to
4087
+ * `config.phoneNumber` — the same rule messaging channels apply via
4088
+ * `resolveOutboundSender`.
4089
+ */
4090
+ protected resolveFromNumber(requested: string | undefined): string;
3885
4091
  }
3886
4092
  /**
3887
4093
  * Base configuration for a {@link VoiceChannel}'s real-time media provider.
@@ -4070,6 +4276,12 @@ declare class ConversationRelayProvider extends VoiceProvider {
4070
4276
  * Send voice response via WebSocket
4071
4277
  */
4072
4278
  sendResponse(conversationId: ConversationId, message: string, metadata?: Record<string, unknown>): Promise<void>;
4279
+ /**
4280
+ * Send the ConversationRelay `end` message if the session has a handoff
4281
+ * pending, so the caller is transferred once the response has been delivered.
4282
+ * No-op when nothing is pending.
4283
+ */
4284
+ private flushPendingHandoff;
4073
4285
  /**
4074
4286
  * Send a streaming voice response via WebSocket, token by token.
4075
4287
  *
@@ -4079,6 +4291,10 @@ declare class ConversationRelayProvider extends VoiceProvider {
4079
4291
  * interrupted), iteration stops and no final marker is sent (the interrupt
4080
4292
  * handler sends the finalization instead).
4081
4293
  *
4294
+ * Once the stream completes, a handoff pending on the session is delivered as
4295
+ * the WS `end` message, matching {@link sendResponse}. An aborted stream
4296
+ * leaves it pending for the next response.
4297
+ *
4082
4298
  * @returns The accumulated full response text.
4083
4299
  */
4084
4300
  sendStreamingResponse(conversationId: ConversationId, stream: AsyncIterable<string>, options?: {
@@ -6299,9 +6515,18 @@ interface TACServerConfig {
6299
6515
  /** Path for Conversation Intelligence webhook (optional - only registered if provided) */
6300
6516
  cintel?: string;
6301
6517
  };
6302
- /** Voice channel instance (alternative to registering on TAC) */
6518
+ /**
6519
+ * Voice channel to serve. The server registers it on TAC (see
6520
+ * {@link TAC.registerChannel}), so it doesn't need registering separately.
6521
+ * Defaults to the voice channel already registered on TAC, if any.
6522
+ */
6303
6523
  voiceChannel?: VoiceChannel;
6304
- /** Messaging channel instances — webhooks are fanned out to all (alternative to registering on TAC) */
6524
+ /**
6525
+ * Messaging channels to serve; conversation webhooks are fanned out to all of
6526
+ * them. The server registers each on TAC (see {@link TAC.registerChannel}), so
6527
+ * they don't need registering separately. Defaults to the SMS, RCS, Chat and
6528
+ * WhatsApp channels already registered on TAC.
6529
+ */
6305
6530
  messagingChannels?: MessagingChannel[];
6306
6531
  }
6307
6532
  /**
@@ -6384,4 +6609,4 @@ declare class TACServer {
6384
6609
  stop(): Promise<void>;
6385
6610
  }
6386
6611
 
6387
- export { type ActionChannelSettings, ActionChannelSettingsSchema, type ActionParticipantRef, ActionParticipantRefSchema, type ActionResponse, ActionResponseSchema, type ActionTextContent, ActionTextContentSchema, type AdapterOptions, type AmdEvent, AmdEventSchema, type AmdHandler, type AnthropicTool, AnthropicToolSchema, type AuthorInfo, AuthorInfoSchema, BaseChannel, type BaseChannelEvents, type BaseChannelOptions, BaseClient, type BuildStreamTwiMLInputs, type BuiltInToolName, BuiltInTools, CALL_EVENT_KINDS, type CallEventKind, CallEventKindSchema, type CallOptions, CallOptionsSchema, type CallStatusEvent, CallStatusEventSchema, type CallStatusHandler, type CaptureRule, CaptureRuleSchema, type ChannelSettings, ChannelSettingsSchema, type ChannelType, ChannelTypeSchema, ChatChannel, type ChatChannelConfig, type CintelParticipant, CintelParticipantSchema, type Communication, type CommunicationContent, CommunicationContentSchema, type CommunicationParticipant, CommunicationParticipantSchema, CommunicationSchema, type ConversationAddress, ConversationAddressSchema, ConversationClient, type ConversationConfiguration, ConversationConfigurationSchema, type ConversationEndedCallback, type ConversationGroupingType, ConversationGroupingTypeSchema, type ConversationId, type ConversationIntelligenceConfig, ConversationIntelligenceConfigSchema, type ConversationParticipant, ConversationParticipantSchema, type ConversationRelayAttributes, ConversationRelayAttributesSchema, type ConversationRelayCallbackPayload, ConversationRelayCallbackPayloadSchema, type ConversationRelayConfig, ConversationRelayConfigSchema, ConversationRelayProvider, ConversationRelayProviderConfig, type ConversationRelayProviderConfigOptions, type ConversationResponse, ConversationResponseSchema, type ConversationSession, ConversationSessionSchema, type ConversationSummaryItem, ConversationSummaryItemSchema, type ConversationWebhookPayload, type CreateConversationSummariesResponse, CreateConversationSummariesResponseSchema, type CreateObservationResponse, CreateObservationResponseSchema, type CreateObservationsRequest, CreateObservationsRequestSchema, type CustomParameters, CustomParametersSchema, type DtmfEvent, type DtmfHandler, type DtmfMessage, DtmfMessageSchema, EMPTY_MEMORY_RESPONSE, EnvironmentVariables, type ExecutionDetails, ExecutionDetailsSchema, GPTLiveProvider, GPTLiveProviderConfig, type GPTLiveProviderConfigOptions, GPT_LIVE_SESSION_ID_METADATA_KEY, type HandoffPayload, HandoffPayloadSchema, type HandoffResult, type InboundCallTwimlHandler, type InitiateChatConversationOptions, type InitiateConversationResult, type InitiateMessagingConversationOptions, InitiateMessagingConversationOptionsSchema, type InitiateVoiceConversationOptions, type InitiateVoiceConversationOptionsGPTLive, InitiateVoiceConversationOptionsGPTLiveSchema, type InitiateVoiceConversationOptionsOpenAIRealtime, InitiateVoiceConversationOptionsOpenAIRealtimeSchema, InitiateVoiceConversationOptionsSchema, type InitiateVoiceConversationResult, type IntelligenceConfiguration, IntelligenceConfigurationSchema, type InterruptCallback, type InterruptMessage, InterruptMessageSchema, type InterruptMode, InterruptModeSchema, type JSONSchema, JSONSchemaSchema, type KnowledgeBase, KnowledgeBaseSchema, type KnowledgeBaseStatus, KnowledgeBaseStatusSchema, type KnowledgeChunkResult, KnowledgeChunkResultSchema, KnowledgeClient, type KnowledgeSearchResponse, KnowledgeSearchResponseSchema, type LanguageAttributes, LanguageAttributesSchema, type LanguageConfig, LanguageConfigSchema, type ListCommunicationsResponse, ListCommunicationsResponseSchema, type ListConversationsResponse, ListConversationsResponseSchema, type ListParticipantsResponse, ListParticipantsResponseSchema, type Logger, MediaStreamsOpenAICallState, MediaStreamsOpenAIProvider, MediaStreamsOpenAIProviderConfig, type MediaStreamsOpenAIProviderConfigOptions, MediaStreamsProviderConfig, type MediaStreamsProviderConfigOptions, type MediaStreamsTwiMLBuilderConfig, type MemoryChannelType, MemoryChannelTypeSchema, MemoryClient, type MemoryCommunication, type MemoryCommunicationContent, MemoryCommunicationContentSchema, MemoryCommunicationSchema, type MemoryDeliveryStatus, MemoryDeliveryStatusSchema, type MemoryMode, MemoryModeSchema, type MemoryParticipant, MemoryParticipantSchema, type MemoryParticipantType, MemoryParticipantTypeSchema, MemoryPromptBuilder, type MemoryRetrievalRequest, MemoryRetrievalRequestSchema, type MemoryRetrievalResponse, MemoryRetrievalResponseSchema, type MessageDirection, MessageDirectionSchema, type MessageReadyCallback, MessagingChannel, type MessagingChannelConfig, type MessagingChannelEvents, OPENAI_USER_AGENT, type ObservationCreateRequest, ObservationCreateRequestSchema, type ObservationInfo, ObservationInfoSchema, OpenAIRealtimeProvider, OpenAIRealtimeProviderConfig, type OpenAIRealtimeProviderConfigOptions, type OpenAIRealtimeTool, OpenAIRealtimeToolSchema, type OpenAITool, OpenAIToolSchema, type Operator, type OperatorProcessingResult, OperatorProcessingResultSchema, type OperatorResult, type OperatorResultEvent, OperatorResultEventSchema, OperatorResultProcessor, OperatorResultSchema, OperatorSchema, type ParticipantAddress, ParticipantAddressSchema, type ParticipantAddressType, ParticipantAddressTypeSchema, type ParticipantId, type PendingHandoffData, PendingHandoffDataSchema, type Profile, type ProfileId, type ProfileLookupResponse, ProfileLookupResponseSchema, type ProfileResponse, ProfileResponseSchema, type PromptMessage, PromptMessageSchema, RCSChannel, type RecordingEvent, RecordingEventSchema, type RecordingHandler, SMSChannel, type SendMessageActionPayload, SendMessageActionPayloadSchema, type SendMessageActionRequest, SendMessageActionRequestSchema, type SessionInfo, SessionInfoSchema, type SessionMessage, SessionMessageSchema, type SetupMessage, SetupMessageSchema, type StatusCallback, StatusCallbackSchema, type StatusTimeouts, StatusTimeoutsSchema, type StreamStartMessage, StreamStartMessageSchema, type StreamTask, type SummaryInfo, SummaryInfoSchema, TAC, type TACChannelType, TACChannelTypeSchema, type TACCommunication, type TACCommunicationAuthor, TACCommunicationAuthorSchema, type TACCommunicationContent, TACCommunicationContentSchema, TACCommunicationSchema, TACConfig, type TACConfigData, TACConfigSchema, type TACDeliveryStatus, TACDeliveryStatusSchema, TACMemoryResponse, type TACOptions, type TACParticipantType, TACParticipantTypeSchema, TACServer, type TACServerConfig, TACTool, TWILIO_AUDIO_FORMAT_FOR_GPT_LIVE, TWILIO_AUDIO_FORMAT_FOR_REALTIME, type TextTokenMessage, TextTokenMessageSchema, type ToolContext, type ToolExecutionResult, ToolExecutionResultSchema, type ToolFunction, type Transcription, TranscriptionSchema, type TranscriptionWord, TranscriptionWordSchema, TwiMLBuilderMediaStreams, type TwiMLOptions, TwiMLOptionsSchema, type TwiMLRequest, TwiMLRequestSchema, type TwilioMemoryConfig, TwilioMemoryConfigSchema, type TwilioProviderCallbackResponse, type TypedCallOptions, VoiceChannel, type VoiceChannelConfig, type VoiceChannelEvents, VoiceProvider, VoiceProviderConfig, type VoiceTwiMLOptions, type VoiceTwiMLOptionsConversationRelay, VoiceTwiMLOptionsConversationRelaySchema, type VoiceTwiMLOptionsMediaStreams, VoiceTwiMLOptionsMediaStreamsSchema, VoiceTwiMLOptionsSchema, type WebSocketMessage, WebSocketMessageSchema, WhatsAppChannel, type _CallsCreateDriftGuards, type _SDKDriftGuards, amdEventFromForm, buildHandoffPayload, callOptionsToCreateParams, callStatusEventFromForm, createKnowledgeSearchTool, createKnowledgeSearchToolAsync, createKnowledgeTools, createLogger, createMemoryRetrievalTool, createMemoryTools, createMessagingTools, createSendMessageTool, createStudioHandoffTool, defineTool, generateStreamTwiml, isConversationId, isParticipantId, isProfileId, maskAddress, maskEmail, maskPhone, postStudioHandoff, recordingEventFromForm, redactTwimlParameters, scrubObject, scrubPii, shutdownAnalytics, studioExecutionsUrl, studioVoiceHandoffUrl, trackEvent, twiMLRequestFromForm };
6612
+ export { type ActionChannelSettings, ActionChannelSettingsSchema, type ActionParticipantRef, ActionParticipantRefSchema, type ActionResponse, ActionResponseSchema, type ActionTextContent, ActionTextContentSchema, type AdapterOptions, type AmdEvent, AmdEventSchema, type AmdHandler, type AnthropicTool, AnthropicToolSchema, type AuthorInfo, AuthorInfoSchema, BaseChannel, type BaseChannelEvents, type BaseChannelOptions, BaseClient, type BuildStreamTwiMLInputs, type BuiltInToolName, BuiltInTools, CALL_EVENT_KINDS, type CallEventKind, CallEventKindSchema, type CallOptions, CallOptionsSchema, type CallStatusEvent, CallStatusEventSchema, type CallStatusHandler, type CaptureRule, CaptureRuleSchema, type ChannelSettings, ChannelSettingsSchema, type ChannelType, ChannelTypeSchema, ChatChannel, type ChatChannelConfig, type CintelParticipant, CintelParticipantSchema, type Communication, type CommunicationContent, CommunicationContentSchema, type CommunicationParticipant, CommunicationParticipantSchema, CommunicationSchema, type ConversationAddress, ConversationAddressSchema, ConversationClient, type ConversationConfiguration, ConversationConfigurationSchema, type ConversationEndedCallback, type ConversationGroupingType, ConversationGroupingTypeSchema, type ConversationId, type ConversationIntelligenceConfig, ConversationIntelligenceConfigSchema, type ConversationParticipant, ConversationParticipantSchema, type ConversationRelayAttributes, ConversationRelayAttributesSchema, type ConversationRelayCallbackPayload, ConversationRelayCallbackPayloadSchema, type ConversationRelayConfig, ConversationRelayConfigSchema, ConversationRelayProvider, ConversationRelayProviderConfig, type ConversationRelayProviderConfigOptions, type ConversationResponse, ConversationResponseSchema, type ConversationSession, ConversationSessionSchema, type ConversationSummaryItem, ConversationSummaryItemSchema, type ConversationWebhookPayload, type CreateConversationSummariesResponse, CreateConversationSummariesResponseSchema, type CreateObservationResponse, CreateObservationResponseSchema, type CreateObservationsRequest, CreateObservationsRequestSchema, type CustomParameters, CustomParametersSchema, type DtmfEvent, type DtmfHandler, type DtmfMessage, DtmfMessageSchema, EMPTY_MEMORY_RESPONSE, EnvironmentVariables, type ExecutionDetails, ExecutionDetailsSchema, GPTLiveProvider, GPTLiveProviderConfig, type GPTLiveProviderConfigOptions, GPT_LIVE_SESSION_ID_METADATA_KEY, type HandoffPayload, HandoffPayloadSchema, type HandoffResult, type InboundCallTwimlHandler, type InitiateChatConversationOptions, type InitiateConversationResult, type InitiateMessagingConversationOptions, InitiateMessagingConversationOptionsSchema, type InitiateVoiceConversationOptions, type InitiateVoiceConversationOptionsGPTLive, InitiateVoiceConversationOptionsGPTLiveSchema, type InitiateVoiceConversationOptionsOpenAIRealtime, InitiateVoiceConversationOptionsOpenAIRealtimeSchema, InitiateVoiceConversationOptionsSchema, type InitiateVoiceConversationResult, type IntelligenceConfiguration, IntelligenceConfigurationSchema, type InterruptCallback, type InterruptMessage, InterruptMessageSchema, type InterruptMode, InterruptModeSchema, type JSONSchema, JSONSchemaSchema, type KnowledgeBase, KnowledgeBaseSchema, type KnowledgeBaseStatus, KnowledgeBaseStatusSchema, type KnowledgeChunkResult, KnowledgeChunkResultSchema, KnowledgeClient, type KnowledgeSearchResponse, KnowledgeSearchResponseSchema, type LanguageAttributes, LanguageAttributesSchema, type LanguageConfig, LanguageConfigSchema, type ListCommunicationsResponse, ListCommunicationsResponseSchema, type ListConversationsResponse, ListConversationsResponseSchema, type ListParticipantsResponse, ListParticipantsResponseSchema, type Logger, MediaStreamsOpenAICallState, MediaStreamsOpenAIProvider, MediaStreamsOpenAIProviderConfig, type MediaStreamsOpenAIProviderConfigOptions, MediaStreamsProviderConfig, type MediaStreamsProviderConfigOptions, type MediaStreamsTwiMLBuilderConfig, type MemoryChannelType, MemoryChannelTypeSchema, MemoryClient, type MemoryCommunication, type MemoryCommunicationContent, MemoryCommunicationContentSchema, MemoryCommunicationSchema, type MemoryDeliveryStatus, MemoryDeliveryStatusSchema, type MemoryMode, MemoryModeSchema, type MemoryParticipant, MemoryParticipantSchema, type MemoryParticipantType, MemoryParticipantTypeSchema, MemoryPromptBuilder, type MemoryRetrievalRequest, MemoryRetrievalRequestSchema, type MemoryRetrievalResponse, MemoryRetrievalResponseSchema, type MessageDirection, MessageDirectionSchema, type MessageReadyCallback, MessagingChannel, type MessagingChannelConfig, type MessagingChannelEvents, OPENAI_USER_AGENT, type ObservationCreateRequest, ObservationCreateRequestSchema, type ObservationInfo, ObservationInfoSchema, OpenAIRealtimeProvider, OpenAIRealtimeProviderConfig, type OpenAIRealtimeProviderConfigOptions, type OpenAIRealtimeTool, OpenAIRealtimeToolSchema, type OpenAITool, OpenAIToolSchema, type Operator, type OperatorProcessingResult, OperatorProcessingResultSchema, type OperatorResult, type OperatorResultEvent, OperatorResultEventSchema, OperatorResultProcessor, OperatorResultSchema, OperatorSchema, type ParticipantAddress, ParticipantAddressSchema, type ParticipantAddressType, ParticipantAddressTypeSchema, type ParticipantId, type PendingHandoffData, PendingHandoffDataSchema, type Profile, type ProfileId, type ProfileLookupResponse, ProfileLookupResponseSchema, type ProfileResponse, ProfileResponseSchema, type PromptMessage, PromptMessageSchema, RCSChannel, type RecordingEvent, RecordingEventSchema, type RecordingHandler, SMSChannel, type SendMessageActionPayload, SendMessageActionPayloadSchema, type SendMessageActionRequest, SendMessageActionRequestSchema, type SessionInfo, SessionInfoSchema, type SessionMessage, SessionMessageSchema, type SetupMessage, SetupMessageSchema, type StatusCallback, StatusCallbackSchema, type StatusTimeouts, StatusTimeoutsSchema, type StreamStartMessage, StreamStartMessageSchema, type StreamTask, type SummaryInfo, SummaryInfoSchema, TAC, type TACChannelType, TACChannelTypeSchema, type TACCommunication, type TACCommunicationAuthor, TACCommunicationAuthorSchema, type TACCommunicationContent, TACCommunicationContentSchema, TACCommunicationSchema, TACConfig, type TACConfigData, type TACConfigInput, TACConfigSchema, type TACDeliveryStatus, TACDeliveryStatusSchema, TACMemoryResponse, type TACOptions, type TACParticipantType, TACParticipantTypeSchema, TACServer, type TACServerConfig, TACTool, TWILIO_AUDIO_FORMAT_FOR_GPT_LIVE, TWILIO_AUDIO_FORMAT_FOR_REALTIME, type TextTokenMessage, TextTokenMessageSchema, type ToolContext, type ToolExecutionResult, ToolExecutionResultSchema, type ToolFunction, type Transcription, TranscriptionSchema, type TranscriptionWord, TranscriptionWordSchema, TwiMLBuilderMediaStreams, type TwiMLOptions, TwiMLOptionsSchema, type TwiMLRequest, TwiMLRequestSchema, type TwilioMemoryConfig, TwilioMemoryConfigSchema, type TwilioProviderCallbackResponse, type TypedCallOptions, VoiceChannel, type VoiceChannelConfig, type VoiceChannelEvents, VoiceProvider, VoiceProviderConfig, type VoiceTwiMLOptions, type VoiceTwiMLOptionsConversationRelay, VoiceTwiMLOptionsConversationRelaySchema, type VoiceTwiMLOptionsMediaStreams, VoiceTwiMLOptionsMediaStreamsSchema, VoiceTwiMLOptionsSchema, type WebSocketMessage, WebSocketMessageSchema, WhatsAppChannel, type _CallsCreateDriftGuards, type _SDKDriftGuards, amdEventFromForm, buildHandoffPayload, callOptionsToCreateParams, callStatusEventFromForm, createKnowledgeSearchTool, createKnowledgeSearchToolAsync, createKnowledgeTools, createLogger, createMemoryRetrievalTool, createMemoryTools, createMessagingTools, createSendMessageTool, createStudioHandoffTool, defineTool, generateStreamTwiml, isConversationId, isParticipantId, isProfileId, maskAddress, maskEmail, maskPhone, postStudioHandoff, recordingEventFromForm, redactTwimlParameters, scrubObject, scrubPii, shutdownAnalytics, studioExecutionsUrl, studioVoiceHandoffUrl, trackEvent, twiMLRequestFromForm };