@sendbird/ai-agent-messenger-react 1.26.0 → 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;
@@ -1756,7 +1786,7 @@ export declare const ConversationLayout: {
1756
1786
  declare interface ConversationLayoutTemplateProps {
1757
1787
  }
1758
1788
 
1759
- export declare const ConversationList: ({ conversationListLimit, conversationListFilter, children, onOpenConversationView, style, }: Props_4) => JSX.Element;
1789
+ export declare const ConversationList: ({ conversationListLimit, conversationListFilter, children, onOpenConversationView, announcementsEnabled, style, }: Props_4) => JSX.Element;
1760
1790
 
1761
1791
  /**
1762
1792
  * A collection for managing AI agent group channels with real-time updates and pagination.
@@ -2395,6 +2425,11 @@ export declare type DateSeparatorProps = SBUFoundationProps<{
2395
2425
  date?: Date | number;
2396
2426
  }>;
2397
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
+
2398
2433
  export declare const DefaultMessenger: ForwardRefExoticComponent<MessengerProps & RefAttributes<MessengerSessionRef>>;
2399
2434
 
2400
2435
  export declare interface DeskClientInterface {
@@ -2665,6 +2700,7 @@ BaseMessageProps<{
2665
2700
  isFeedbackEnabled?: boolean;
2666
2701
  isFeedbackCommentEnabled?: boolean;
2667
2702
  isSenderAvatarVisible?: boolean;
2703
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2668
2704
 
2669
2705
  // handlers
2670
2706
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
@@ -2744,6 +2780,7 @@ export declare const IncomingMessageLayout: {
2744
2780
  isFeedbackEnabled?: boolean;
2745
2781
  isFeedbackCommentEnabled?: boolean;
2746
2782
  isSenderAvatarVisible?: boolean;
2783
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2747
2784
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2748
2785
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2749
2786
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -2817,6 +2854,7 @@ export declare const IncomingMessageLayout: {
2817
2854
  isFeedbackEnabled?: boolean;
2818
2855
  isFeedbackCommentEnabled?: boolean;
2819
2856
  isSenderAvatarVisible?: boolean;
2857
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2820
2858
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2821
2859
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2822
2860
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -2890,6 +2928,7 @@ export declare const IncomingMessageLayout: {
2890
2928
  isFeedbackEnabled?: boolean;
2891
2929
  isFeedbackCommentEnabled?: boolean;
2892
2930
  isSenderAvatarVisible?: boolean;
2931
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2893
2932
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2894
2933
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2895
2934
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -2994,6 +3033,7 @@ export declare const IncomingMessageLayout: {
2994
3033
  isFeedbackEnabled?: boolean;
2995
3034
  isFeedbackCommentEnabled?: boolean;
2996
3035
  isSenderAvatarVisible?: boolean;
3036
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2997
3037
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2998
3038
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2999
3039
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3067,6 +3107,7 @@ export declare const IncomingMessageLayout: {
3067
3107
  isFeedbackEnabled?: boolean;
3068
3108
  isFeedbackCommentEnabled?: boolean;
3069
3109
  isSenderAvatarVisible?: boolean;
3110
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3070
3111
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3071
3112
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3072
3113
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3140,6 +3181,7 @@ export declare const IncomingMessageLayout: {
3140
3181
  isFeedbackEnabled?: boolean;
3141
3182
  isFeedbackCommentEnabled?: boolean;
3142
3183
  isSenderAvatarVisible?: boolean;
3184
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3143
3185
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3144
3186
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3145
3187
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3239,6 +3281,7 @@ export declare const IncomingMessageLayout: {
3239
3281
  isFeedbackEnabled?: boolean;
3240
3282
  isFeedbackCommentEnabled?: boolean;
3241
3283
  isSenderAvatarVisible?: boolean;
3284
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3242
3285
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3243
3286
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3244
3287
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3312,6 +3355,7 @@ export declare const IncomingMessageLayout: {
3312
3355
  isFeedbackEnabled?: boolean;
3313
3356
  isFeedbackCommentEnabled?: boolean;
3314
3357
  isSenderAvatarVisible?: boolean;
3358
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3315
3359
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3316
3360
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3317
3361
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3385,6 +3429,7 @@ export declare const IncomingMessageLayout: {
3385
3429
  isFeedbackEnabled?: boolean;
3386
3430
  isFeedbackCommentEnabled?: boolean;
3387
3431
  isSenderAvatarVisible?: boolean;
3432
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3388
3433
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3389
3434
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3390
3435
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3507,6 +3552,7 @@ export declare const IncomingMessageLayout: {
3507
3552
  isFeedbackEnabled?: boolean;
3508
3553
  isFeedbackCommentEnabled?: boolean;
3509
3554
  isSenderAvatarVisible?: boolean;
3555
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3510
3556
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3511
3557
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3512
3558
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3580,6 +3626,7 @@ export declare const IncomingMessageLayout: {
3580
3626
  isFeedbackEnabled?: boolean;
3581
3627
  isFeedbackCommentEnabled?: boolean;
3582
3628
  isSenderAvatarVisible?: boolean;
3629
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3583
3630
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3584
3631
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3585
3632
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3653,6 +3700,7 @@ export declare const IncomingMessageLayout: {
3653
3700
  isFeedbackEnabled?: boolean;
3654
3701
  isFeedbackCommentEnabled?: boolean;
3655
3702
  isSenderAvatarVisible?: boolean;
3703
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3656
3704
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3657
3705
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3658
3706
  onHandleTemplateInternalAction?: (action: Action) => void;
@@ -3851,6 +3899,8 @@ declare interface ManualSessionInfoParams {
3851
3899
  sessionHandler: AIAgentSessionHandler;
3852
3900
  }
3853
3901
 
3902
+ declare type MarkdownImageRenderMode = 'default' | 'complete-only';
3903
+
3854
3904
  declare interface MemoryInfo {
3855
3905
  enabled: boolean;
3856
3906
  showIndicator: boolean;
@@ -4435,6 +4485,7 @@ declare type Props_4 = PropsWithChildren<{
4435
4485
  conversationListLimit?: number;
4436
4486
  conversationListFilter?: Partial<AIAgentGroupChannelFilter>;
4437
4487
  onOpenConversationView?: (channelUrl: string, status: 'open' | 'closed') => void;
4488
+ announcementsEnabled?: boolean;
4438
4489
  /** Custom styles for the conversation list container. */
4439
4490
  style?: CSSProperties;
4440
4491
  }>;