@sendbird/ai-agent-messenger-react 1.25.0 → 1.26.1

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
@@ -423,7 +423,8 @@ declare type AIAgentCommonIconName =
423
423
  | 'photo'
424
424
  | 'add'
425
425
  | 'document'
426
- | 'download';
426
+ | 'download'
427
+ | 'memory';
427
428
 
428
429
  export declare interface AIAgentConfig {
429
430
  conversation?: {
@@ -520,6 +521,10 @@ declare interface AIAgentContextValue {
520
521
  declare interface AIAgentConversationContextValue {
521
522
  conversation: ChatSDKConversation | undefined;
522
523
 
524
+ actions: {
525
+ setUserMemoryState: (params: { enabled: boolean }) => Promise<MemoryInfo>;
526
+ };
527
+
523
528
  channelSource: {
524
529
  channel: ChatSDKGroupChannel | undefined;
525
530
  error: ChatSDKSendbirdError | undefined;
@@ -692,10 +697,15 @@ declare interface AIAgentInterface {
692
697
  updateContext: (channelUrl: string, context: Record<string, string>) => Promise<ContextObject>;
693
698
  /** Retrieves the context data for the specified channel */
694
699
  getContextObject: (channelUrl: string) => Promise<ContextObject>;
700
+ /** Clears memories saved for the current user */
701
+ clearUserMemories: (params?: ClearUserMemoriesParams) => Promise<void>;
695
702
 
696
703
  /** @internal Refreshes the active channel by re-requesting messenger settings */
697
704
  refreshActiveChannel: (options?: { useKnownActiveChannelUrl?: boolean }) => Promise<string>;
698
705
 
706
+ /** @internal Sets whether the current user uses memory */
707
+ setUserMemoryState: (params: SetUserMemoryStateParams) => Promise<MemoryInfo>;
708
+
699
709
  /** @internal Initializes a conversation on the channel if needed (AI Agent channel without conversation). */
700
710
  initConversationIfNeeded: (channel: ChatSDKGroupChannel) => Promise<void>;
701
711
 
@@ -727,6 +737,7 @@ declare interface AIAgentMessengerSessionContextValue {
727
737
  userSession: null | UserSession;
728
738
  aiAgentInfo: null | AIAgentInfo;
729
739
  launcherInfo: null | LauncherInfo;
740
+ memoryInfo: null | MemoryInfo;
730
741
 
731
742
  connectionError?: Error;
732
743
 
@@ -1072,6 +1083,10 @@ declare interface AIAgentStringSet {
1072
1083
  a11y_file_image: (name: string) => string;
1073
1084
  a11y_file_video: (name: string) => string;
1074
1085
  a11y_file_document: (name: string) => string;
1086
+ a11y_received_file_image: string;
1087
+ a11y_received_file_video: string;
1088
+ a11y_received_file_pdf: (name: string) => string;
1089
+ a11y_received_files_image_count: (count: number) => string;
1075
1090
  a11y_screen_conversation: string;
1076
1091
  a11y_screen_conversation_with_agent: (name: string) => string;
1077
1092
  a11y_screen_conversation_list_no_count: string;
@@ -1130,7 +1145,7 @@ declare interface AIAgentStringSet {
1130
1145
  question: string;
1131
1146
  submit_label: string;
1132
1147
  submission_expired: string;
1133
- a11y_rating_label: (score: number, label: string) => string;
1148
+ a11y_csat_rating_label: (score: number, label: string) => string;
1134
1149
  a11y_hint_select_rating: string;
1135
1150
  };
1136
1151
 
@@ -1168,6 +1183,24 @@ declare interface AIAgentStringSet {
1168
1183
  confirm_handoff: string;
1169
1184
  };
1170
1185
 
1186
+ memory: {
1187
+ dialog_title: string;
1188
+ desc_on: string;
1189
+ desc_off: string;
1190
+ button_use: string;
1191
+ button_dont_use: string;
1192
+ button_keep_using: string;
1193
+ button_disable: string;
1194
+ button_disable_and_delete: string;
1195
+ button_keep_off: string;
1196
+ button_enable: string;
1197
+ button_cancel: string;
1198
+ error_message: string;
1199
+ a11y_indicator_manage: string;
1200
+ a11y_indicator_on: string;
1201
+ a11y_indicator_off: string;
1202
+ };
1203
+
1171
1204
  connection_delay: {
1172
1205
  title: string;
1173
1206
  description: (formattedTime: string) => string;
@@ -1229,6 +1262,14 @@ declare type BaseMessageProps<T> = T & {
1229
1262
  children?: ReactNode;
1230
1263
  };
1231
1264
 
1265
+ /**
1266
+ * Settings shape persisted in the cache layer. The server always returns `memory`,
1267
+ * but caches written before the field was introduced may not have it.
1268
+ */
1269
+ declare type CachedMessengerSettings = Omit<MessengerSettingsResponse, 'memory'> & {
1270
+ memory?: MessengerSettingsResponse['memory'];
1271
+ };
1272
+
1232
1273
  declare type ChatSDKAIAgentChannelFilter = AIAgentChannelFilter;
1233
1274
 
1234
1275
  declare type ChatSDKAIAgentGroupChannelListQuery = AIAgentGroupChannelListQuery;
@@ -1295,6 +1336,10 @@ export declare interface CitationInfo {
1295
1336
  link: string;
1296
1337
  }
1297
1338
 
1339
+ declare interface ClearUserMemoriesParams {
1340
+ contextAiAgentId?: string;
1341
+ }
1342
+
1298
1343
  declare interface CloseConversationCommandParams {
1299
1344
  channelUrl: string;
1300
1345
  }
@@ -1327,6 +1372,17 @@ declare interface ColorSet {
1327
1372
  csat: {
1328
1373
  background: string;
1329
1374
  };
1375
+ memoryDialog: {
1376
+ titleText: string;
1377
+ markdownBodyText: string;
1378
+ markdownLinkText: string;
1379
+ positiveBackground: string;
1380
+ positiveText: string;
1381
+ positiveBorderColor: string;
1382
+ negativeBackground: string;
1383
+ negativeText: string;
1384
+ negativeBorderColor: string;
1385
+ };
1330
1386
  }
1331
1387
 
1332
1388
  /**
@@ -1444,6 +1500,7 @@ export declare const ConversationHeaderLayout: {
1444
1500
  EndArea: () => ReactNode;
1445
1501
  MenuButton: () => ReactNode;
1446
1502
  Title: () => ReactNode;
1503
+ MemoryIndicator: () => ReactNode;
1447
1504
  HandoffButton: () => ReactNode;
1448
1505
  ConversationCloseButton: () => ReactNode;
1449
1506
  ExpandButton: () => ReactNode;
@@ -1460,6 +1517,7 @@ export declare const ConversationHeaderLayout: {
1460
1517
  EndArea: () => ReactNode;
1461
1518
  MenuButton: () => ReactNode;
1462
1519
  Title: () => ReactNode;
1520
+ MemoryIndicator: () => ReactNode;
1463
1521
  HandoffButton: () => ReactNode;
1464
1522
  ConversationCloseButton: () => ReactNode;
1465
1523
  ExpandButton: () => ReactNode;
@@ -1471,6 +1529,7 @@ export declare const ConversationHeaderLayout: {
1471
1529
  EndArea: () => ReactNode;
1472
1530
  MenuButton: () => ReactNode;
1473
1531
  Title: () => ReactNode;
1532
+ MemoryIndicator: () => ReactNode;
1474
1533
  HandoffButton: () => ReactNode;
1475
1534
  ConversationCloseButton: () => ReactNode;
1476
1535
  ExpandButton: () => ReactNode;
@@ -1492,6 +1551,9 @@ export declare const ConversationHeaderLayout: {
1492
1551
  Title: (props: {
1493
1552
  component: () => ReactNode;
1494
1553
  }) => null;
1554
+ MemoryIndicator: (props: {
1555
+ component: () => ReactNode;
1556
+ }) => null;
1495
1557
  HandoffButton: (props: {
1496
1558
  component: () => ReactNode;
1497
1559
  }) => null;
@@ -1694,7 +1756,7 @@ export declare const ConversationLayout: {
1694
1756
  declare interface ConversationLayoutTemplateProps {
1695
1757
  }
1696
1758
 
1697
- export declare const ConversationList: ({ conversationListLimit, conversationListFilter, children, onOpenConversationView, style, }: Props_4) => JSX.Element;
1759
+ export declare const ConversationList: ({ conversationListLimit, conversationListFilter, children, onOpenConversationView, announcementsEnabled, style, }: Props_4) => JSX.Element;
1698
1760
 
1699
1761
  /**
1700
1762
  * A collection for managing AI agent group channels with real-time updates and pagination.
@@ -2093,12 +2155,14 @@ declare interface ConversationListContextProps {
2093
2155
  conversationListLimit?: number;
2094
2156
  conversationListFilter?: Partial<AIAgentGroupChannelFilter>;
2095
2157
  onOpenConversationView?: (channelUrl: string, status: 'open' | 'closed') => void;
2158
+ announcementsEnabled?: boolean;
2096
2159
  }
2097
2160
 
2098
- export declare function ConversationListContextProvider({ conversationListLimit, conversationListFilter, onOpenConversationView, children, }: PropsWithChildren<ConversationListContextProps>): JSX.Element;
2161
+ export declare function ConversationListContextProvider({ conversationListLimit, conversationListFilter, onOpenConversationView, announcementsEnabled, children, }: PropsWithChildren<ConversationListContextProps>): JSX.Element;
2099
2162
 
2100
2163
  declare interface ConversationListContextValue extends AIAgentConversationListContextValue {
2101
2164
  onOpenConversationView: (channelUrl: string, status: 'open' | 'closed') => void;
2165
+ announcementsEnabled: boolean;
2102
2166
  }
2103
2167
 
2104
2168
  export declare const ConversationListHeaderLayout: {
@@ -3789,6 +3853,14 @@ declare interface ManualSessionInfoParams {
3789
3853
  sessionHandler: AIAgentSessionHandler;
3790
3854
  }
3791
3855
 
3856
+ declare interface MemoryInfo {
3857
+ enabled: boolean;
3858
+ showIndicator: boolean;
3859
+ toggleAllowed: boolean;
3860
+ deleteOnOff: boolean;
3861
+ consentDialog: MessengerSettingsResponse['memory']['consent_dialog'];
3862
+ }
3863
+
3792
3864
  /**
3793
3865
  * @description
3794
3866
  * - single: The message is standalone (not grouped with adjacent messages).
@@ -3933,7 +4005,7 @@ declare interface MessengerProps extends AIAgentProps {
3933
4005
  }
3934
4006
 
3935
4007
  declare interface MessengerSessionCache {
3936
- getSettings(userId: string): MessengerSettingsResponse | null;
4008
+ getSettings(userId: string): CachedMessengerSettings | null;
3937
4009
  setSettings(userId: string, value: MessengerSettingsResponse): void;
3938
4010
  getAnonUser(): AnonUserSessionData | null;
3939
4011
  setAnonUser(value: AnonUserSessionData): void;
@@ -3992,6 +4064,13 @@ declare interface MessengerSettingsResponse {
3992
4064
  image_url: string;
3993
4065
  auto_open: boolean;
3994
4066
  };
4067
+ memory: {
4068
+ enabled: boolean;
4069
+ show_indicator: boolean;
4070
+ toggle_allowed: boolean;
4071
+ delete_on_off: boolean;
4072
+ consent_dialog: { body: string } | null;
4073
+ };
3995
4074
  auto_created_user?: {
3996
4075
  user_id: string;
3997
4076
  session_token: string;
@@ -4008,10 +4087,9 @@ declare interface MessengerSettingsResponse {
4008
4087
  country: string | null;
4009
4088
  }
4010
4089
 
4011
- declare interface MessengerSettingsUpdatedParams {
4012
- settings: MessengerSettingsResponse;
4013
- source: 'cache' | 'server';
4014
- }
4090
+ declare type MessengerSettingsUpdatedParams =
4091
+ | { settings: MessengerSettingsResponse; source: 'server' }
4092
+ | { settings: CachedMessengerSettings; source: 'cache' };
4015
4093
 
4016
4094
  declare type MultiSelectField = {
4017
4095
  key: string;
@@ -4359,6 +4437,7 @@ declare type Props_4 = PropsWithChildren<{
4359
4437
  conversationListLimit?: number;
4360
4438
  conversationListFilter?: Partial<AIAgentGroupChannelFilter>;
4361
4439
  onOpenConversationView?: (channelUrl: string, status: 'open' | 'closed') => void;
4440
+ announcementsEnabled?: boolean;
4362
4441
  /** Custom styles for the conversation list container. */
4363
4442
  style?: CSSProperties;
4364
4443
  }>;
@@ -4392,6 +4471,11 @@ declare interface SearchConversationParams {
4392
4471
  context: Record<string, string>;
4393
4472
  }
4394
4473
 
4474
+ declare interface SetUserMemoryStateParams {
4475
+ enabled: boolean;
4476
+ contextAiAgentId?: string;
4477
+ }
4478
+
4395
4479
  declare type SingleSelectField = {
4396
4480
  key: string;
4397
4481
  type: 'single-select';
@@ -4564,6 +4648,10 @@ declare type StringSet = {
4564
4648
  A11Y_FILE_IMAGE: (name: string) => string;
4565
4649
  A11Y_FILE_VIDEO: (name: string) => string;
4566
4650
  A11Y_FILE_DOCUMENT: (name: string) => string;
4651
+ A11Y_RECEIVED_FILE_IMAGE: string;
4652
+ A11Y_RECEIVED_FILE_VIDEO: string;
4653
+ A11Y_RECEIVED_FILE_PDF: (name: string) => string;
4654
+ A11Y_RECEIVED_FILES_IMAGE_COUNT: (count: number) => string;
4567
4655
  A11Y_FILE_SELECTED?: (label: string) => string;
4568
4656
  A11Y_FILE_REMOVE_BUTTON: (name: string) => string;
4569
4657
  A11Y_SCREEN_CONVERSATION: string;
@@ -4576,7 +4664,6 @@ declare type StringSet = {
4576
4664
  A11Y_FILE_SIZE_EXCEEDED: (maxSizeMB: number) => string;
4577
4665
  A11Y_CSAT_FORM_ERROR: string;
4578
4666
  A11Y_CONVERSATION_ITEM: (agent: string, status: string, time: string, count: number) => string;
4579
- A11Y_RATING_LABEL: (score: number, label: string) => string;
4580
4667
  A11Y_CONNECT_AGENT: string;
4581
4668
  A11Y_CLOSE_MESSENGER: string;
4582
4669
  A11Y_EXPAND_MESSENGER: string;
@@ -4598,6 +4685,21 @@ declare type StringSet = {
4598
4685
  HANDOFF_CONFIRM__DESCRIPTION: string;
4599
4686
  HANDOFF_CONFIRM__CANCEL: string;
4600
4687
  HANDOFF_CONFIRM__HANDOFF: string;
4688
+ MEMORY__DIALOG_TITLE: string;
4689
+ MEMORY__DESC_ON: string;
4690
+ MEMORY__DESC_OFF: string;
4691
+ MEMORY__BUTTON_USE: string;
4692
+ MEMORY__BUTTON_DONT_USE: string;
4693
+ MEMORY__BUTTON_KEEP_USING: string;
4694
+ MEMORY__BUTTON_DISABLE: string;
4695
+ MEMORY__BUTTON_DISABLE_AND_DELETE: string;
4696
+ MEMORY__BUTTON_KEEP_OFF: string;
4697
+ MEMORY__BUTTON_ENABLE: string;
4698
+ MEMORY__BUTTON_CANCEL: string;
4699
+ MEMORY__ERROR_MESSAGE: string;
4700
+ A11Y_MEMORY_INDICATOR_MANAGE: string;
4701
+ A11Y_MEMORY_INDICATOR_ON: string;
4702
+ A11Y_MEMORY_INDICATOR_OFF: string;
4601
4703
  CONNECTION_DELAY__TITLE: string;
4602
4704
  CONNECTION_DELAY__DESCRIPTION: (formattedTime: string) => string;
4603
4705
  /** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/