@sendbird/ai-agent-messenger-react 1.26.1 → 1.27.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/dist/index.d.ts CHANGED
@@ -238,7 +238,7 @@ queryParams?: AIAgentQueryParams;
238
238
  * @public
239
239
  * @description AIAgent global default config.
240
240
  * */
241
- config?: AIAgentConfig;
241
+ config?: DeepPartial<AIAgentConfig_2>;
242
242
  /** @internal */
243
243
  deskParams?: {
244
244
  customApiHost?: string;
@@ -426,69 +426,98 @@ declare type AIAgentCommonIconName =
426
426
  | 'download'
427
427
  | 'memory';
428
428
 
429
- export declare interface AIAgentConfig {
430
- conversation?: {
431
- /**
432
- * Whether to show the "Start new conversation" button at the end of the message list.
433
- * @default true
434
- * */
435
- isTalkToAgentViewEnabled?: boolean;
436
- /**
437
- * Controls the scroll behavior of the conversation.
438
- * - `auto`: Automatically scrolls to bottom on new messages and streaming.
439
- * - `fixed`: Pins new messages at viewport top, maintains position during streaming.
440
- * @default 'auto'
441
- * */
442
- scrollMode?: ConversationScrollMode;
443
- /**
444
- * Whether to show the new message indicator button when scrolled away from bottom.
445
- * @default true
446
- * */
447
- newMessageIndicatorEnabled?: boolean;
448
- /**
449
- * Whether to show the sender's avatar image next to each message.
450
- * @default true
451
- * */
452
- senderAvatarEnabled?: boolean;
453
- header?: {
429
+ /**
430
+ * Public input shape for the AI Agent config. Deep-partial of the canonical
431
+ * resolved config the SDK consumes internally — every field is optional so
432
+ * callers only supply the values they want to override. `mergeAIAgentConfig`
433
+ * fills in the rest before reaching React contexts.
434
+ */
435
+ export declare type AIAgentConfig = DeepPartial<AIAgentConfig_2>;
436
+
437
+ /**
438
+ * Canonical AI Agent config every field is required after `mergeAIAgentConfig`.
439
+ * User-facing input uses `DeepPartial<AIAgentConfig>`.
440
+ */
441
+ declare interface AIAgentConfig_2 {
442
+ conversation: {
443
+ /** @deprecated Use `list.isTalkToAgentViewEnabled` instead. */
444
+ isTalkToAgentViewEnabled: boolean;
445
+ /** @deprecated Use `list.scrollMode` instead. */
446
+ scrollMode: ConversationScrollMode;
447
+ /** @deprecated Use `list.newMessageIndicatorEnabled` instead. */
448
+ newMessageIndicatorEnabled: boolean;
449
+ /** @deprecated Use `list.senderAvatarEnabled` instead. */
450
+ senderAvatarEnabled: boolean;
451
+ list: {
452
+ /**
453
+ * Whether to show the "Start new conversation" button at the end of the message list.
454
+ * @default true
455
+ * */
456
+ isTalkToAgentViewEnabled: boolean;
457
+ /**
458
+ * Controls the scroll behavior of the conversation.
459
+ * - `auto`: Automatically scrolls to bottom on new messages and streaming.
460
+ * - `fixed`: Pins new messages at viewport top, maintains position during streaming.
461
+ * @default 'auto'
462
+ * */
463
+ scrollMode: ConversationScrollMode;
464
+ /**
465
+ * Whether to show the new message indicator button when scrolled away from bottom.
466
+ * @default true
467
+ * */
468
+ newMessageIndicatorEnabled: boolean;
469
+ /**
470
+ * Whether to show the sender's avatar image next to each message.
471
+ * @default true
472
+ * */
473
+ senderAvatarEnabled: boolean;
474
+ /**
475
+ * Controls how markdown images are displayed while a message is streaming.
476
+ * - `default`: Renders partial markdown as-is.
477
+ * - `complete-only`: Hides incomplete image markdown until the image token is complete.
478
+ * @default 'default'
479
+ * */
480
+ markdownImageRenderMode: MarkdownImageRenderMode;
481
+ };
482
+ header: {
454
483
  /**
455
484
  * Whether to show the avatar in the conversation header.
456
485
  * @default true
457
486
  * */
458
- avatarEnabled?: boolean;
487
+ avatarEnabled: boolean;
459
488
  };
460
- input?: {
489
+ input: {
461
490
  /**
462
491
  * (React-Native only) Whether to enable the camera option in the attachment menu.
463
492
  * */
464
- camera?: {
465
- photoEnabled?: boolean;
493
+ camera: {
494
+ photoEnabled: boolean;
466
495
  };
467
496
  /**
468
497
  * Whether to enable the gallery/photo option in the attachment menu.
469
498
  * */
470
- gallery?: {
471
- photoEnabled?: boolean;
499
+ gallery: {
500
+ photoEnabled: boolean;
472
501
  };
473
502
  /**
474
503
  * Whether to enable the file option in the attachment menu.
475
504
  * */
476
- fileEnabled?: boolean;
505
+ fileEnabled: boolean;
477
506
  };
478
507
  /**
479
508
  * (React only) Whether to play an alert sound when a message is received from the AI agent while the browser is not focused.
480
509
  * @default false
481
510
  * */
482
- messageAlertSoundEnabled?: boolean;
511
+ messageAlertSoundEnabled: boolean;
483
512
  /**
484
513
  * File viewer configuration.
485
514
  * */
486
- fileViewer?: {
515
+ fileViewer: {
487
516
  /**
488
517
  * Whether to show the download button in the file viewer.
489
518
  * @default true
490
519
  * */
491
- downloadEnabled?: boolean;
520
+ downloadEnabled: boolean;
492
521
  };
493
522
  };
494
523
  }
@@ -513,7 +542,7 @@ declare interface AIAgentContextValue {
513
542
  networkStateAdapter?: NetworkStateAdapter;
514
543
 
515
544
  queryParams?: AIAgentQueryParams;
516
- config?: AIAgentConfig;
545
+ config: AIAgentConfig_2;
517
546
 
518
547
  handlers?: AIAgentClientHandlers;
519
548
  }
@@ -651,9 +680,9 @@ declare interface AIAgentInterface {
651
680
  readonly session: AIAgentSession | null;
652
681
  /** The Desk client. Available after authenticate(). */
653
682
  readonly deskClient: DeskClientInterface;
654
- // TODO: Change to `AIAgentConfig` (non-optional) once the context migration lands and all usages are updated
655
- /** The AI Agent configuration */
656
- config: AIAgentConfig | undefined;
683
+ /** The AI Agent configuration. */
684
+ get config(): AIAgentConfig_2;
685
+ set config(value: DeepPartial<AIAgentConfig_2> | undefined);
657
686
  /** The query parameters for AI Agent */
658
687
  queryParams?: AIAgentQueryParams;
659
688
  /** The adapter for detecting online/offline network state */
@@ -887,7 +916,7 @@ export declare type AIAgentProps = PropsWithChildren<{
887
916
  * @public
888
917
  * @description AIAgent global default config.
889
918
  * */
890
- config?: AIAgentConfig;
919
+ config?: DeepPartial<AIAgentConfig_2>;
891
920
  /** @internal */
892
921
  deskParams?: {
893
922
  customApiHost?: string;
@@ -1100,6 +1129,7 @@ declare interface AIAgentStringSet {
1100
1129
  a11y_hint_open_conversation: string;
1101
1130
  a11y_hint_open_conversations: string;
1102
1131
  a11y_hint_close_conversation: string;
1132
+ a11y_hint_close_messenger: string;
1103
1133
  a11y_hint_open_menu: string;
1104
1134
  a11y_hint_connect_to_agent: string;
1105
1135
  a11y_hint_attach_file: string;
@@ -2155,14 +2185,12 @@ declare interface ConversationListContextProps {
2155
2185
  conversationListLimit?: number;
2156
2186
  conversationListFilter?: Partial<AIAgentGroupChannelFilter>;
2157
2187
  onOpenConversationView?: (channelUrl: string, status: 'open' | 'closed') => void;
2158
- announcementsEnabled?: boolean;
2159
2188
  }
2160
2189
 
2161
- export declare function ConversationListContextProvider({ conversationListLimit, conversationListFilter, onOpenConversationView, announcementsEnabled, children, }: PropsWithChildren<ConversationListContextProps>): JSX.Element;
2190
+ export declare function ConversationListContextProvider({ conversationListLimit, conversationListFilter, onOpenConversationView, children, }: PropsWithChildren<ConversationListContextProps>): JSX.Element;
2162
2191
 
2163
2192
  declare interface ConversationListContextValue extends AIAgentConversationListContextValue {
2164
2193
  onOpenConversationView: (channelUrl: string, status: 'open' | 'closed') => void;
2165
- announcementsEnabled: boolean;
2166
2194
  }
2167
2195
 
2168
2196
  export declare const ConversationListHeaderLayout: {
@@ -2397,6 +2425,11 @@ export declare type DateSeparatorProps = SBUFoundationProps<{
2397
2425
  date?: Date | number;
2398
2426
  }>;
2399
2427
 
2428
+ /**
2429
+ * Recursively makes every property of T optional, including nested objects.
2430
+ */
2431
+ declare type DeepPartial<T> = T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
2432
+
2400
2433
  export declare const DefaultMessenger: ForwardRefExoticComponent<MessengerProps & RefAttributes<MessengerSessionRef>>;
2401
2434
 
2402
2435
  export declare interface DeskClientInterface {
@@ -2667,6 +2700,7 @@ BaseMessageProps<{
2667
2700
  isFeedbackEnabled?: boolean;
2668
2701
  isFeedbackCommentEnabled?: boolean;
2669
2702
  isSenderAvatarVisible?: boolean;
2703
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2670
2704
 
2671
2705
  // handlers
2672
2706
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
@@ -2746,6 +2780,7 @@ export declare const IncomingMessageLayout: {
2746
2780
  isFeedbackEnabled?: boolean;
2747
2781
  isFeedbackCommentEnabled?: boolean;
2748
2782
  isSenderAvatarVisible?: boolean;
2783
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2749
2784
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2750
2785
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2751
2786
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -2819,6 +2854,7 @@ export declare const IncomingMessageLayout: {
2819
2854
  isFeedbackEnabled?: boolean;
2820
2855
  isFeedbackCommentEnabled?: boolean;
2821
2856
  isSenderAvatarVisible?: boolean;
2857
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2822
2858
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2823
2859
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2824
2860
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -2892,6 +2928,7 @@ export declare const IncomingMessageLayout: {
2892
2928
  isFeedbackEnabled?: boolean;
2893
2929
  isFeedbackCommentEnabled?: boolean;
2894
2930
  isSenderAvatarVisible?: boolean;
2931
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2895
2932
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2896
2933
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2897
2934
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -2996,6 +3033,7 @@ export declare const IncomingMessageLayout: {
2996
3033
  isFeedbackEnabled?: boolean;
2997
3034
  isFeedbackCommentEnabled?: boolean;
2998
3035
  isSenderAvatarVisible?: boolean;
3036
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2999
3037
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3000
3038
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3001
3039
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3069,6 +3107,7 @@ export declare const IncomingMessageLayout: {
3069
3107
  isFeedbackEnabled?: boolean;
3070
3108
  isFeedbackCommentEnabled?: boolean;
3071
3109
  isSenderAvatarVisible?: boolean;
3110
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3072
3111
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3073
3112
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3074
3113
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3142,6 +3181,7 @@ export declare const IncomingMessageLayout: {
3142
3181
  isFeedbackEnabled?: boolean;
3143
3182
  isFeedbackCommentEnabled?: boolean;
3144
3183
  isSenderAvatarVisible?: boolean;
3184
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3145
3185
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3146
3186
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3147
3187
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3241,6 +3281,7 @@ export declare const IncomingMessageLayout: {
3241
3281
  isFeedbackEnabled?: boolean;
3242
3282
  isFeedbackCommentEnabled?: boolean;
3243
3283
  isSenderAvatarVisible?: boolean;
3284
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3244
3285
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3245
3286
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3246
3287
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3314,6 +3355,7 @@ export declare const IncomingMessageLayout: {
3314
3355
  isFeedbackEnabled?: boolean;
3315
3356
  isFeedbackCommentEnabled?: boolean;
3316
3357
  isSenderAvatarVisible?: boolean;
3358
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3317
3359
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3318
3360
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3319
3361
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3387,6 +3429,7 @@ export declare const IncomingMessageLayout: {
3387
3429
  isFeedbackEnabled?: boolean;
3388
3430
  isFeedbackCommentEnabled?: boolean;
3389
3431
  isSenderAvatarVisible?: boolean;
3432
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3390
3433
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3391
3434
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3392
3435
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3509,6 +3552,7 @@ export declare const IncomingMessageLayout: {
3509
3552
  isFeedbackEnabled?: boolean;
3510
3553
  isFeedbackCommentEnabled?: boolean;
3511
3554
  isSenderAvatarVisible?: boolean;
3555
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3512
3556
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3513
3557
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3514
3558
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3582,6 +3626,7 @@ export declare const IncomingMessageLayout: {
3582
3626
  isFeedbackEnabled?: boolean;
3583
3627
  isFeedbackCommentEnabled?: boolean;
3584
3628
  isSenderAvatarVisible?: boolean;
3629
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3585
3630
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3586
3631
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3587
3632
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3655,6 +3700,7 @@ export declare const IncomingMessageLayout: {
3655
3700
  isFeedbackEnabled?: boolean;
3656
3701
  isFeedbackCommentEnabled?: boolean;
3657
3702
  isSenderAvatarVisible?: boolean;
3703
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3658
3704
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3659
3705
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3660
3706
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3853,6 +3899,8 @@ declare interface ManualSessionInfoParams {
3853
3899
  sessionHandler: AIAgentSessionHandler;
3854
3900
  }
3855
3901
 
3902
+ declare type MarkdownImageRenderMode = 'default' | 'complete-only';
3903
+
3856
3904
  declare interface MemoryInfo {
3857
3905
  enabled: boolean;
3858
3906
  showIndicator: boolean;