@sendbird/ai-agent-messenger-react 1.20.0 → 1.21.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
@@ -128,6 +128,7 @@ export declare interface AgentPreviewConfigs {
128
128
  imageUrl: string;
129
129
  };
130
130
  forceCreateChannel?: boolean;
131
+ agentVersion?: number;
131
132
  agentAttributes?: {
132
133
  ai?: Record<string, unknown>;
133
134
  safeguard?: Record<string, unknown>;
@@ -602,6 +603,9 @@ declare interface AIAgentInterface {
602
603
  /** The context object for AI Agent */
603
604
  context?: Record<string, string>;
604
605
 
606
+ /** @internal Agent version for conversation initialization */
607
+ agentVersion?: number;
608
+
605
609
  /** @internal Stats trackers for performance monitoring */
606
610
  readonly statsTrackers: {
607
611
  initialRender: ConversationInitialRenderStatsTracker;
@@ -629,6 +633,9 @@ declare interface AIAgentInterface {
629
633
  /** @internal Refreshes the active channel by re-requesting messenger settings */
630
634
  refreshActiveChannel: (options?: { useKnownActiveChannelUrl?: boolean }) => Promise<string>;
631
635
 
636
+ /** @internal Initializes a conversation on the channel if needed (AI Agent channel without conversation). */
637
+ initConversationIfNeeded: (channel: GroupChannel) => Promise<void>;
638
+
632
639
  /** Disposes all resources held by this instance (WebSocket, desk auth, event handlers). */
633
640
  dispose: () => void;
634
641
 
@@ -1928,15 +1935,9 @@ declare interface ConversationScrollContextValue {
1928
1935
  ref: RefObject<HTMLDivElement | null> | ((element: HTMLDivElement | null) => void);
1929
1936
  state: {
1930
1937
  bottomSpace: number;
1931
- /**
1932
- * Whether user has scrolled away from the latest messages.
1933
- * Use this to determine when to show floating action buttons (scroll to bottom, new messages, etc.)
1934
- */
1935
1938
  isAwayFromBottom: boolean;
1936
- /**
1937
- * Determines whether new messages should be counted.
1938
- * Returns true when user is not at bottom (browsing old messages).
1939
- */
1939
+ /** Whether programmatic scroll has completed. False during optimistic updates, true after reconciliation. */
1940
+ isScrollPositionReconciled: boolean;
1940
1941
  shouldCountNewMessages: () => boolean;
1941
1942
  };
1942
1943
  props: {
@@ -2325,6 +2326,7 @@ BaseMessageProps<{
2325
2326
  nickname: string;
2326
2327
  profileUrl?: string;
2327
2328
  };
2329
+ thinkingMessage?: string;
2328
2330
 
2329
2331
  // flags
2330
2332
  suggestedRepliesVisible?: boolean;
@@ -2381,7 +2383,7 @@ export declare const IncomingMessageLayout: {
2381
2383
  MediaMessageBody: typeof IncomingMediaBody;
2382
2384
  FileMessageBody: typeof IncomingFileBody;
2383
2385
  MultipleFilesMessageBody: ({ files, children, onClickMedia, onClickMediaFiles, }: IncomingMessageBodyProps<"multipleFiles">) => JSX.Element;
2384
- TypingIndicator: ({ customStyle }: IncomingMessageProps & {
2386
+ TypingIndicator: ({ thinkingMessage, customStyle }: IncomingMessageProps & {
2385
2387
  customStyle?: {
2386
2388
  bubbleContentColor?: string;
2387
2389
  bubbleBackgroundColor?: string;
@@ -2404,6 +2406,7 @@ export declare const IncomingMessageLayout: {
2404
2406
  nickname: string;
2405
2407
  profileUrl?: string;
2406
2408
  };
2409
+ thinkingMessage?: string;
2407
2410
  suggestedRepliesVisible?: boolean;
2408
2411
  suggestedRepliesDirection?: "vertical" | "horizontal";
2409
2412
  isBotMessage?: boolean;
@@ -2476,6 +2479,7 @@ export declare const IncomingMessageLayout: {
2476
2479
  nickname: string;
2477
2480
  profileUrl?: string;
2478
2481
  };
2482
+ thinkingMessage?: string;
2479
2483
  suggestedRepliesVisible?: boolean;
2480
2484
  suggestedRepliesDirection?: "vertical" | "horizontal";
2481
2485
  isBotMessage?: boolean;
@@ -2548,6 +2552,7 @@ export declare const IncomingMessageLayout: {
2548
2552
  nickname: string;
2549
2553
  profileUrl?: string;
2550
2554
  };
2555
+ thinkingMessage?: string;
2551
2556
  suggestedRepliesVisible?: boolean;
2552
2557
  suggestedRepliesDirection?: "vertical" | "horizontal";
2553
2558
  isBotMessage?: boolean;
@@ -2628,7 +2633,7 @@ export declare const IncomingMessageLayout: {
2628
2633
  MediaMessageBody: typeof IncomingMediaBody;
2629
2634
  FileMessageBody: typeof IncomingFileBody;
2630
2635
  MultipleFilesMessageBody: ({ files, children, onClickMedia, onClickMediaFiles, }: IncomingMessageBodyProps<"multipleFiles">) => JSX.Element;
2631
- TypingIndicator: ({ customStyle }: IncomingMessageProps & {
2636
+ TypingIndicator: ({ thinkingMessage, customStyle }: IncomingMessageProps & {
2632
2637
  customStyle?: {
2633
2638
  bubbleContentColor?: string;
2634
2639
  bubbleBackgroundColor?: string;
@@ -2651,6 +2656,7 @@ export declare const IncomingMessageLayout: {
2651
2656
  nickname: string;
2652
2657
  profileUrl?: string;
2653
2658
  };
2659
+ thinkingMessage?: string;
2654
2660
  suggestedRepliesVisible?: boolean;
2655
2661
  suggestedRepliesDirection?: "vertical" | "horizontal";
2656
2662
  isBotMessage?: boolean;
@@ -2723,6 +2729,7 @@ export declare const IncomingMessageLayout: {
2723
2729
  nickname: string;
2724
2730
  profileUrl?: string;
2725
2731
  };
2732
+ thinkingMessage?: string;
2726
2733
  suggestedRepliesVisible?: boolean;
2727
2734
  suggestedRepliesDirection?: "vertical" | "horizontal";
2728
2735
  isBotMessage?: boolean;
@@ -2795,6 +2802,7 @@ export declare const IncomingMessageLayout: {
2795
2802
  nickname: string;
2796
2803
  profileUrl?: string;
2797
2804
  };
2805
+ thinkingMessage?: string;
2798
2806
  suggestedRepliesVisible?: boolean;
2799
2807
  suggestedRepliesDirection?: "vertical" | "horizontal";
2800
2808
  isBotMessage?: boolean;
@@ -2870,7 +2878,7 @@ export declare const IncomingMessageLayout: {
2870
2878
  MediaMessageBody: typeof IncomingMediaBody;
2871
2879
  FileMessageBody: typeof IncomingFileBody;
2872
2880
  MultipleFilesMessageBody: ({ files, children, onClickMedia, onClickMediaFiles, }: IncomingMessageBodyProps<"multipleFiles">) => JSX.Element;
2873
- TypingIndicator: ({ customStyle }: IncomingMessageProps & {
2881
+ TypingIndicator: ({ thinkingMessage, customStyle }: IncomingMessageProps & {
2874
2882
  customStyle?: {
2875
2883
  bubbleContentColor?: string;
2876
2884
  bubbleBackgroundColor?: string;
@@ -2893,6 +2901,7 @@ export declare const IncomingMessageLayout: {
2893
2901
  nickname: string;
2894
2902
  profileUrl?: string;
2895
2903
  };
2904
+ thinkingMessage?: string;
2896
2905
  suggestedRepliesVisible?: boolean;
2897
2906
  suggestedRepliesDirection?: "vertical" | "horizontal";
2898
2907
  isBotMessage?: boolean;
@@ -2965,6 +2974,7 @@ export declare const IncomingMessageLayout: {
2965
2974
  nickname: string;
2966
2975
  profileUrl?: string;
2967
2976
  };
2977
+ thinkingMessage?: string;
2968
2978
  suggestedRepliesVisible?: boolean;
2969
2979
  suggestedRepliesDirection?: "vertical" | "horizontal";
2970
2980
  isBotMessage?: boolean;
@@ -3037,6 +3047,7 @@ export declare const IncomingMessageLayout: {
3037
3047
  nickname: string;
3038
3048
  profileUrl?: string;
3039
3049
  };
3050
+ thinkingMessage?: string;
3040
3051
  suggestedRepliesVisible?: boolean;
3041
3052
  suggestedRepliesDirection?: "vertical" | "horizontal";
3042
3053
  isBotMessage?: boolean;
@@ -3139,7 +3150,7 @@ export declare const IncomingMessageLayout: {
3139
3150
  component: ({ files, children, onClickMedia, onClickMediaFiles, }: IncomingMessageBodyProps<"multipleFiles">) => JSX.Element;
3140
3151
  }) => null;
3141
3152
  TypingIndicator: (props: {
3142
- component: ({ customStyle }: IncomingMessageProps & {
3153
+ component: ({ thinkingMessage, customStyle }: IncomingMessageProps & {
3143
3154
  customStyle?: {
3144
3155
  bubbleContentColor?: string;
3145
3156
  bubbleBackgroundColor?: string;
@@ -3158,6 +3169,7 @@ export declare const IncomingMessageLayout: {
3158
3169
  nickname: string;
3159
3170
  profileUrl?: string;
3160
3171
  };
3172
+ thinkingMessage?: string;
3161
3173
  suggestedRepliesVisible?: boolean;
3162
3174
  suggestedRepliesDirection?: "vertical" | "horizontal";
3163
3175
  isBotMessage?: boolean;
@@ -3230,6 +3242,7 @@ export declare const IncomingMessageLayout: {
3230
3242
  nickname: string;
3231
3243
  profileUrl?: string;
3232
3244
  };
3245
+ thinkingMessage?: string;
3233
3246
  suggestedRepliesVisible?: boolean;
3234
3247
  suggestedRepliesDirection?: "vertical" | "horizontal";
3235
3248
  isBotMessage?: boolean;
@@ -3302,6 +3315,7 @@ export declare const IncomingMessageLayout: {
3302
3315
  nickname: string;
3303
3316
  profileUrl?: string;
3304
3317
  };
3318
+ thinkingMessage?: string;
3305
3319
  suggestedRepliesVisible?: boolean;
3306
3320
  suggestedRepliesDirection?: "vertical" | "horizontal";
3307
3321
  isBotMessage?: boolean;
@@ -3418,6 +3432,7 @@ declare type InputState = {
3418
3432
  | 'conversation_closed'
3419
3433
  | 'suggested_replies'
3420
3434
  | 'reconnecting'
3435
+ | 'handoff_pending'
3421
3436
  | (string & {});
3422
3437
  };
3423
3438