@sendbird/ai-agent-messenger-react 1.27.0 → 1.29.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
@@ -1,12 +1,10 @@
1
1
  import { Action } from '@sendbird/uikit-message-template';
2
2
  import type { AIAgentChannelFilter } from '@sendbird/chat/aiAgent';
3
- import type { AIAgentGroupChannelListQuery } from '@sendbird/chat/aiAgent';
4
3
  import type { AIAgentModule } from '@sendbird/chat/aiAgent';
5
- import type { BaseChannel } from '@sendbird/chat';
4
+ import type { BaseChannelCollectionEventHandler } from '@sendbird/chat/groupChannel';
6
5
  import type { BaseMessage } from '@sendbird/chat/message';
7
6
  import type { CollectionEventSource } from '@sendbird/chat';
8
7
  import { ComponentType } from 'react';
9
- import type { ConnectionHandler } from '@sendbird/chat';
10
8
  import { Context } from 'react';
11
9
  import type { Conversation as Conversation_2 } from '@sendbird/chat/aiAgent';
12
10
  import type { ConversationStatus } from '@sendbird/chat/aiAgent';
@@ -17,9 +15,6 @@ import type { FileMessageCreateParams } from '@sendbird/chat/message';
17
15
  import { format } from 'date-fns';
18
16
  import { ForwardRefExoticComponent } from 'react';
19
17
  import type { GroupChannel } from '@sendbird/chat/groupChannel';
20
- import type { GroupChannelChangelogs } from '@sendbird/chat/aiAgent';
21
- import type { GroupChannelHandler } from '@sendbird/chat/groupChannel';
22
- import type { GroupChannelListOrder } from '@sendbird/chat/groupChannel';
23
18
  import type { GroupChannelModule } from '@sendbird/chat/groupChannel';
24
19
  import { JSX } from 'react/jsx-runtime';
25
20
  import type { Locale } from 'date-fns';
@@ -392,6 +387,14 @@ declare type AIAgentChatSDKParams = ChatSDKSendbirdChatParams<[ChatSDKGroupChann
392
387
 
393
388
  declare interface AIAgentClientHandlers {
394
389
  onCustomEvent?: (event: CustomEvent_2) => void;
390
+ /**
391
+ * Called whenever the SDK opens an external URL — markdown links, admin-message
392
+ * URLs, citation links, CTA buttons, and non-media file-preview clicks.
393
+ * Provide this to intercept link navigation (analytics, deep links, custom
394
+ * schemes). When omitted, the SDK falls back to `window.open` on web and
395
+ * `Linking.openURL` on React Native.
396
+ */
397
+ onClickLink?: (params: { url: string }) => void;
395
398
  }
396
399
 
397
400
  declare type AIAgentCommonIconName =
@@ -520,6 +523,15 @@ declare interface AIAgentConfig_2 {
520
523
  downloadEnabled: boolean;
521
524
  };
522
525
  };
526
+ launcher: {
527
+ /**
528
+ * Whether to show a red-dot badge on the launcher when there are unread
529
+ * messages in AI agent channels. The count is fetched once on connect and
530
+ * again after each successful reconnect (not in real time).
531
+ * @default false
532
+ * */
533
+ unreadBadgeEnabled: boolean;
534
+ };
523
535
  }
524
536
 
525
537
  declare interface AIAgentContextValue {
@@ -719,7 +731,7 @@ declare interface AIAgentInterface {
719
731
  /** Closes an open conversation */
720
732
  closeConversation: (channelUrl: string) => Promise<void>;
721
733
  /** Creates a collection for paginating through conversations */
722
- createConversationListCollection: (params?: ConversationListCollectionParams) => ConversationListCollection;
734
+ createConversationListCollection: (params?: ConversationListCollectionParams) => ConversationListCollectionInterface;
723
735
  /** Patches (merges) context data for the specified channel */
724
736
  patchContext: (channelUrl: string, context: Record<string, string>) => Promise<ContextObject>;
725
737
  /** Replaces the entire context data for the specified channel */
@@ -1111,6 +1123,7 @@ declare interface AIAgentStringSet {
1111
1123
  a11y_conversation_closed: string;
1112
1124
  a11y_file_image: (name: string) => string;
1113
1125
  a11y_file_video: (name: string) => string;
1126
+ a11y_file_pdf: (name: string) => string;
1114
1127
  a11y_file_document: (name: string) => string;
1115
1128
  a11y_received_file_image: string;
1116
1129
  a11y_received_file_video: string;
@@ -1288,6 +1301,7 @@ declare type BaseMessageProps<T> = T & {
1288
1301
  onClickMedia?: (params: { url: string; type: string }) => void;
1289
1302
  onClickMediaFiles?: (params: { files: Array<{ url: string; type: string; name?: string }>; index: number }) => void;
1290
1303
  onClickFile?: (params: { url: string; type: string }) => void;
1304
+ onClickLink?: (params: { url: string }) => void;
1291
1305
 
1292
1306
  children?: ReactNode;
1293
1307
  };
@@ -1300,20 +1314,29 @@ declare type CachedMessengerSettings = Omit<MessengerSettingsResponse, 'memory'>
1300
1314
  memory?: MessengerSettingsResponse['memory'];
1301
1315
  };
1302
1316
 
1303
- declare type ChatSDKAIAgentChannelFilter = AIAgentChannelFilter;
1317
+ export declare type ChallengeActionParams = {
1318
+ key: string;
1319
+ requestId: string;
1320
+ action: 'submit' | 'cancel';
1321
+ data?: Record<string, unknown>;
1322
+ };
1323
+
1324
+ export declare interface ChallengeInfo {
1325
+ key: string;
1326
+ request_id: string;
1327
+ status: 'pending' | 'succeeded' | 'failed' | 'canceled' | (string & {});
1328
+ }
1304
1329
 
1305
- declare type ChatSDKAIAgentGroupChannelListQuery = AIAgentGroupChannelListQuery;
1330
+ declare type ChatSDKAIAgentChannelFilter = AIAgentChannelFilter;
1306
1331
 
1307
1332
  declare type ChatSDKAIAgentModule = AIAgentModule;
1308
1333
 
1309
- declare type ChatSDKBaseChannel = BaseChannel;
1334
+ declare type ChatSDKBaseChannelCollectionEventHandler = BaseChannelCollectionEventHandler;
1310
1335
 
1311
1336
  declare type ChatSDKBaseMessage = BaseMessage;
1312
1337
 
1313
1338
  declare type ChatSDKCollectionEventSource = CollectionEventSource;
1314
1339
 
1315
- declare type ChatSDKConnectionHandler = ConnectionHandler;
1316
-
1317
1340
  declare type ChatSDKConversation = Conversation_2;
1318
1341
 
1319
1342
  declare type ChatSDKConversationStatus = ConversationStatus;
@@ -1326,12 +1349,6 @@ declare type ChatSDKFileMessageCreateParams = FileMessageCreateParams;
1326
1349
 
1327
1350
  declare type ChatSDKGroupChannel = GroupChannel;
1328
1351
 
1329
- declare type ChatSDKGroupChannelChangelogs = GroupChannelChangelogs;
1330
-
1331
- declare type ChatSDKGroupChannelHandler = GroupChannelHandler;
1332
-
1333
- declare type ChatSDKGroupChannelListOrder = GroupChannelListOrder;
1334
-
1335
1352
  declare type ChatSDKGroupChannelModule = GroupChannelModule;
1336
1353
 
1337
1354
  declare type ChatSDKLogLevel = LogLevel_2;
@@ -1789,382 +1806,15 @@ declare interface ConversationLayoutTemplateProps {
1789
1806
  export declare const ConversationList: ({ conversationListLimit, conversationListFilter, children, onOpenConversationView, announcementsEnabled, style, }: Props_4) => JSX.Element;
1790
1807
 
1791
1808
  /**
1792
- * A collection for managing AI agent group channels with real-time updates and pagination.
1793
- * Automatically separates pinned and non-pinned channels, with pinned channels prioritized at the top.
1809
+ * Public interface for ConversationListCollection.
1810
+ * Exposes only the public contract without leaking internal BaseChannelCollection generics.
1794
1811
  */
1795
- declare class ConversationListCollection {
1796
- /** The filter configuration used for this collection */
1797
- readonly filter?: AIAgentGroupChannelFilter;
1798
-
1799
- private _sdk: ChatSDKType;
1800
- private _pinnedChannels: ChatSDKGroupChannel[];
1801
- private _channels: ChatSDKGroupChannel[];
1802
-
1803
- private _isDisposed = false;
1804
- private _handlerId = `handler-id-${Date.now()}`;
1805
- private _order: ChatSDKGroupChannelListOrder = GroupChannelListOrder.LATEST_LAST_MESSAGE;
1806
-
1807
- private _limit: number;
1808
- private _query: ChatSDKAIAgentGroupChannelListQuery;
1809
-
1810
- private _token: string;
1811
- private _timestamp: number;
1812
- private _isSyncing: boolean;
1813
-
1814
- private _channelHandler: ChatSDKGroupChannelHandler;
1815
- private _connectionHandler: ChatSDKConnectionHandler;
1816
- private _collectionEventHandler?: ConversationListCollectionEventHandler;
1817
- private _throttledOnChannelChanged: ThrottledFunction<(channel: ChatSDKBaseChannel) => void>;
1818
-
1819
- /**
1820
- * Creates a new ConversationListCollection instance.
1821
- * @param sdk - The Sendbird Chat SDK instance
1822
- * @param params - Configuration parameters for the collection
1823
- */
1824
- constructor(sdk: ChatSDKType, { filter, limit = 20 }: ConversationListCollectionParams) {
1825
- this.filter = filter;
1826
-
1827
- this._sdk = sdk;
1828
- this._pinnedChannels = [];
1829
- this._channels = [];
1830
-
1831
- this._limit = limit;
1832
- this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
1833
- aiAgentChannelFilter: this.filter?.aiAgentChannelFilter,
1834
- aiAgentConversationStatusFilter: this.filter?.aiAgentConversationStatusFilter,
1835
- aiAgentIds: this.filter?.aiAgentIds,
1836
- deskChannelFilter: this.filter?.deskChannelFilter,
1837
- pinnedChannelUrls: this.filter?.pinnedChannelUrls,
1838
- copilotConversationOnly: this.filter?.copilotConversationOnly,
1839
- copilotSupportChannelUrl: this.filter?.copilotSupportChannelUrl,
1840
- limit: this._limit,
1841
- });
1842
-
1843
- this._token = '';
1844
- this._timestamp = Number.MAX_SAFE_INTEGER;
1845
- this._isSyncing = false;
1846
-
1847
- this._throttledOnChannelChanged = throttle(
1848
- (channel: ChatSDKGroupChannel) => {
1849
- if (this._query.belongsTo(channel)) {
1850
- this._addChannelsToView([channel], false);
1851
- } else {
1852
- this._removeChannelsFromView([channel.url]);
1853
- }
1854
- },
1855
- 250,
1856
- { trailing: false, leading: true },
1857
- );
1858
-
1859
- this._channelHandler = new GroupChannelHandler({
1860
- onChannelChanged: (channel) => {
1861
- if (!channel.isGroupChannel()) return;
1862
- this._throttledOnChannelChanged(channel);
1863
- },
1864
- onChannelDeleted: (channelUrl) => {
1865
- this._removeChannelsFromView([channelUrl]);
1866
- },
1867
- });
1868
-
1869
- this._connectionHandler = new ConnectionHandler({
1870
- onReconnectSucceeded: () => {
1871
- if (this._isDefaultChangelogSyncTimestampUpdated) this._syncChannelChangelogs();
1872
- },
1873
- });
1874
-
1875
- this._sdk.addConnectionHandler(this._handlerId, this._connectionHandler);
1876
- this._sdk.groupChannel.addGroupChannelHandler(this._handlerId, this._channelHandler);
1877
- }
1878
-
1879
- /**
1880
- * Checks if the default changelog sync timestamp has been updated.
1881
- */
1882
- private get _isDefaultChangelogSyncTimestampUpdated() {
1883
- return this._timestamp !== Number.MAX_SAFE_INTEGER;
1884
- }
1885
-
1886
- /**
1887
- * Sets the default changelog sync timestamp based on the first non-pinned channel.
1888
- * @param channels - Array of channels to analyze
1889
- */
1890
- private _setDefaultChangelogsSyncTimestamp(channels: ChatSDKGroupChannel[]) {
1891
- const pinnedUrlsSet = new Set(this.filter?.pinnedChannelUrls ?? []);
1892
- const firstChannel = channels.find((it) => {
1893
- return !pinnedUrlsSet.has(it.url);
1894
- });
1895
-
1896
- let candidate: number;
1897
- if (firstChannel) {
1898
- candidate = firstChannel.lastMessage?.createdAt ?? firstChannel.createdAt;
1899
- } else {
1900
- candidate = this._query.lastResponseAt;
1901
- }
1902
-
1903
- if (this._timestamp > candidate) {
1904
- this._timestamp = candidate;
1905
- }
1906
- }
1907
-
1908
- /**
1909
- * Synchronizes channel changelogs to keep the collection up-to-date.
1910
- * @returns Promise that resolves to an empty array
1911
- */
1912
- private async _syncChannelChangelogs(): Promise<ChatSDKGroupChannel[]> {
1913
- if (this._isDisposed) return [];
1914
- if (this._isSyncing) return [];
1915
-
1916
- try {
1917
- this._isSyncing = true;
1918
- let response: ChatSDKGroupChannelChangelogs;
1919
-
1920
- if (this._token) {
1921
- response = await this._sdk.aiAgent.getMyGroupChannelChangeLogsByToken(this._token, this.filter);
1922
- } else {
1923
- response = await this._sdk.aiAgent.getMyGroupChannelChangeLogsByTimestamp(this._timestamp, this.filter);
1924
- }
1925
- this._token = response.token;
1926
- this._addChannelsToView(response.updatedChannels);
1927
- this._removeChannelsFromView(response.deletedChannelUrls);
1928
-
1929
- while (response.hasMore && !!response.token) {
1930
- response = await this._sdk.aiAgent.getMyGroupChannelChangeLogsByToken(this._token, this.filter);
1931
- this._token = response.token;
1932
- this._addChannelsToView(response.updatedChannels);
1933
- this._removeChannelsFromView(response.deletedChannelUrls);
1934
- }
1935
- } catch (error) {
1936
- // Silently handle changelog sync errors to prevent disrupting the collection
1937
- // The collection will continue to work with existing data
1938
- } finally {
1939
- this._isSyncing = false;
1940
- }
1941
- return [];
1942
- }
1943
-
1944
- /**
1945
- * Upserts pinned channels maintaining the order specified in pinnedChannelUrls.
1946
- * @param channels - Pinned channels to upsert
1947
- * @returns Object containing added, updated channels and unmatched URLs
1948
- */
1949
- private _upsertPinnedChannelsToArray(channels: ChatSDKGroupChannel[]): {
1950
- addedChannels: ChatSDKGroupChannel[];
1951
- updatedChannels: ChatSDKGroupChannel[];
1952
- unmatchedChannelUrls: string[];
1953
- } {
1954
- const pinnedUrls = this.filter?.pinnedChannelUrls ?? [];
1955
- const pinnedIndexMap = new Map(pinnedUrls.map((url, index) => [url, index]));
1956
-
1957
- const addedChannels: ChatSDKGroupChannel[] = [];
1958
- const updatedChannels: ChatSDKGroupChannel[] = [];
1959
- const unmatchedChannelUrls: string[] = [];
1960
-
1961
- for (const channel of channels) {
1962
- if (!this._query.belongsTo(channel)) {
1963
- unmatchedChannelUrls.push(channel.url);
1964
- continue;
1965
- }
1966
-
1967
- const targetIndex = pinnedIndexMap.get(channel.url);
1968
- if (targetIndex === undefined) continue;
1969
-
1970
- const existingPosition = indexOfChannel(this._pinnedChannels, channel);
1971
- const isExisting = existingPosition >= 0;
1972
-
1973
- if (isExisting) {
1974
- this._pinnedChannels.splice(existingPosition, 1);
1975
- updatedChannels.push(channel);
1976
- } else {
1977
- addedChannels.push(channel);
1978
- }
1979
-
1980
- const insertPosition = this._pinnedChannels.findIndex((existingChannel) => {
1981
- const existingIndex = pinnedIndexMap.get(existingChannel.url) ?? Infinity;
1982
- return existingIndex > targetIndex;
1983
- });
1984
-
1985
- const finalPosition = insertPosition === -1 ? this._pinnedChannels.length : insertPosition;
1986
- this._pinnedChannels.splice(finalPosition, 0, channel);
1987
- }
1988
-
1989
- return { addedChannels, updatedChannels, unmatchedChannelUrls };
1990
- }
1991
-
1992
- /**
1993
- * Upserts regular (non-pinned) channels with time-based sorting.
1994
- * @param channels - Regular channels to upsert
1995
- * @param forceAppend - Whether to force append channels at the end regardless of hasMore status
1996
- * @returns Object containing added, updated channels and unmatched URLs
1997
- */
1998
- private _upsertRegularChannelsToArray(
1999
- channels: ChatSDKGroupChannel[],
2000
- forceAppend = false,
2001
- ): { addedChannels: ChatSDKGroupChannel[]; updatedChannels: ChatSDKGroupChannel[]; unmatchedChannelUrls: string[] } {
2002
- const unmatchedChannelUrls: string[] = [];
2003
-
2004
- const addedChannels: ChatSDKGroupChannel[] = [];
2005
- const updatedChannels: ChatSDKGroupChannel[] = [];
2006
-
2007
- for (const channel of channels) {
2008
- if (!this._query.belongsTo(channel)) {
2009
- unmatchedChannelUrls.push(channel.url);
2010
- continue;
2011
- }
2012
-
2013
- const oldPosition = indexOfChannel(this._channels, channel);
2014
- const isNewChannel = oldPosition < 0;
2015
- const shouldRemoveBeforeInsert = !isNewChannel;
2016
-
2017
- if (shouldRemoveBeforeInsert) {
2018
- this._channels.splice(oldPosition, 1);
2019
- }
2020
-
2021
- const insertionIndex = placeOfChannel(this._channels, channel, this._order).place;
2022
- const isAtEnd = insertionIndex === this._channels.length;
2023
-
2024
- if (isNewChannel) {
2025
- if (isAtEnd) {
2026
- if (forceAppend || !this.hasMore) {
2027
- this._channels.push(channel);
2028
- addedChannels.push(channel);
2029
- }
2030
- } else {
2031
- this._channels.splice(insertionIndex, 0, channel);
2032
- addedChannels.push(channel);
2033
- }
2034
- } else {
2035
- this._channels.splice(insertionIndex, 0, channel);
2036
- updatedChannels.push(channel);
2037
- }
2038
- }
2039
-
2040
- return { addedChannels, updatedChannels, unmatchedChannelUrls };
2041
- }
2042
-
2043
- /**
2044
- * Adds or updates channels in the collection, separating pinned and non-pinned channels.
2045
- * @param channels - Channels to add or update
2046
- * @param forceAppend - Whether to force append channels at the end
2047
- */
2048
- private _addChannelsToView(channels: ChatSDKGroupChannel[], forceAppend = false): void {
2049
- const pinnedUrlsSet = new Set(this.filter?.pinnedChannelUrls ?? []);
2050
-
2051
- const pinnedChannels: ChatSDKGroupChannel[] = [];
2052
- const regularChannels: ChatSDKGroupChannel[] = [];
2053
-
2054
- for (const channel of channels) {
2055
- if (pinnedUrlsSet.has(channel.url)) {
2056
- pinnedChannels.push(channel);
2057
- } else {
2058
- regularChannels.push(channel);
2059
- }
2060
- }
2061
-
2062
- const pinnedResult = this._upsertPinnedChannelsToArray(pinnedChannels);
2063
- const regularResult = this._upsertRegularChannelsToArray(regularChannels, forceAppend);
2064
-
2065
- const addedChannels = pinnedResult.addedChannels.concat(regularResult.addedChannels);
2066
- const updatedChannels = pinnedResult.updatedChannels.concat(regularResult.updatedChannels);
2067
- const unmatchedChannelUrls = pinnedResult.unmatchedChannelUrls.concat(regularResult.unmatchedChannelUrls);
2068
-
2069
- if (addedChannels.length > 0) this._collectionEventHandler?.onChannelsAdded?.({}, addedChannels);
2070
- if (updatedChannels.length > 0) this._collectionEventHandler?.onChannelsUpdated?.({}, updatedChannels);
2071
- if (unmatchedChannelUrls.length > 0) this._removeChannelsFromView(unmatchedChannelUrls);
2072
- }
2073
-
2074
- /**
2075
- * Removes channels from the collection by their URLs.
2076
- * @param channelUrls - Array of channel URLs to remove
2077
- */
2078
- private _removeChannelsFromView(channelUrls: string[]) {
2079
- const pinnedUrlsSet = new Set(this.filter?.pinnedChannelUrls ?? []);
2080
- const removedChannelUrls: string[] = [];
2081
-
2082
- for (const channelUrl of channelUrls) {
2083
- if (pinnedUrlsSet.has(channelUrl)) {
2084
- const index = this._pinnedChannels.findIndex((channel) => channel.url === channelUrl);
2085
- if (index >= 0) {
2086
- removedChannelUrls.push(channelUrl);
2087
- this._pinnedChannels.splice(index, 1);
2088
- }
2089
- } else {
2090
- const index = this._channels.findIndex((channel) => channel.url === channelUrl);
2091
- if (index >= 0) {
2092
- removedChannelUrls.push(channelUrl);
2093
- this._channels.splice(index, 1);
2094
- }
2095
- }
2096
- }
2097
-
2098
- if (removedChannelUrls.length > 0) this._collectionEventHandler?.onChannelsDeleted?.({}, removedChannelUrls);
2099
- }
2100
-
2101
- /**
2102
- * Gets all channels in the collection.
2103
- * Pinned channels are always returned first, followed by non-pinned channels.
2104
- * @returns Array of GroupChannel objects
2105
- */
2106
- public get channels(): ChatSDKGroupChannel[] {
2107
- return this._isDisposed ? [] : [...this._pinnedChannels, ...this._channels];
2108
- }
2109
-
2110
- /**
2111
- * Indicates whether the collection has more channels to load.
2112
- * @returns True if more channels can be loaded, false otherwise
2113
- */
2114
- public get hasMore(): boolean {
2115
- return this._isDisposed ? false : this._query.hasNext;
2116
- }
2117
-
2118
- /**
2119
- * Loads the next batch of channels from the server.
2120
- * @returns Promise that resolves to an array of newly loaded channels
2121
- */
2122
- public async loadMore(): Promise<ChatSDKGroupChannel[]> {
2123
- if (this._isDisposed) return [];
2124
-
2125
- if (this.hasMore) {
2126
- const channels = await this._query.next();
2127
-
2128
- this._setDefaultChangelogsSyncTimestamp(channels);
2129
- this._addChannelsToView(channels, true);
2130
- return channels;
2131
- }
2132
-
2133
- return [];
2134
- }
2135
-
2136
- /**
2137
- * Sets the event handler for collection updates.
2138
- * @param handler - Event handler for channel collection changes
2139
- */
2140
- public setConversationListCollectionHandler(handler: ConversationListCollectionEventHandler): void {
2141
- this._collectionEventHandler = handler;
2142
- }
2143
-
2144
- /**
2145
- * Disposes the collection and cleans up all resources.
2146
- * Stops all event handlers and clears all channels.
2147
- */
2148
- public dispose(): void {
2149
- if (this._isDisposed) return;
2150
-
2151
- this._isDisposed = true;
2152
- this._throttledOnChannelChanged.cancel();
2153
- this._collectionEventHandler = undefined;
2154
- this._sdk.removeConnectionHandler(this._handlerId);
2155
- this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId);
2156
- this._pinnedChannels.length = 0;
2157
- this._channels.length = 0;
2158
- }
2159
- }
2160
-
2161
- declare interface ConversationListCollectionEventHandler {
2162
- /** Called when there are newly added {@link GroupChannel}s. */
2163
- onChannelsAdded?: (context: ConversationListContext_2, channels: ChatSDKGroupChannel[]) => void;
2164
- /** Called when there's an update in one or more of the {@link GroupChannel}s that `GroupChannelCollection` holds. */
2165
- onChannelsUpdated?: (context: ConversationListContext_2, channels: ChatSDKGroupChannel[]) => void;
2166
- /** Called when one or more of the {@link GroupChannel}s that `GroupChannelCollection` holds has been deleted. */
2167
- onChannelsDeleted?: (context: ConversationListContext_2, channelUrls: string[]) => void;
1812
+ declare interface ConversationListCollectionInterface {
1813
+ readonly channels: ChatSDKGroupChannel[];
1814
+ readonly hasMore: boolean;
1815
+ loadMore(): Promise<ChatSDKGroupChannel[]>;
1816
+ setConversationListCollectionHandler(handler: ChatSDKBaseChannelCollectionEventHandler): void;
1817
+ dispose(): void;
2168
1818
  }
2169
1819
 
2170
1820
  /**
@@ -2179,8 +1829,6 @@ declare interface ConversationListCollectionParams {
2179
1829
 
2180
1830
  export declare const ConversationListContext: Context<ConversationListContextValue | null>;
2181
1831
 
2182
- declare interface ConversationListContext_2 {}
2183
-
2184
1832
  declare interface ConversationListContextProps {
2185
1833
  conversationListLimit?: number;
2186
1834
  conversationListFilter?: Partial<AIAgentGroupChannelFilter>;
@@ -2566,6 +2214,7 @@ export declare interface ExtendedMessagePayload {
2566
2214
  | 'safeguard'
2567
2215
  | 'error';
2568
2216
  citations?: CitationInfo[];
2217
+ challenge?: ChallengeInfo;
2569
2218
  feedback?: FeedbackInfo;
2570
2219
  form?: Form;
2571
2220
  steward?: Steward;
@@ -2712,6 +2361,7 @@ BaseMessageProps<{
2712
2361
  onFeedbackUpdate?: (params: { rating: 'good' | 'bad'; comment?: string } | null) => void;
2713
2362
  onSubmitForm?: (params: { key: string; data: Record<string, FormFieldValue> }) => Promise<void>;
2714
2363
  onCancelForm?: (params: { key: string }) => Promise<void>;
2364
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2715
2365
  onStreamAnimationStart?: () => void;
2716
2366
  onStreamAnimationProgress?: () => void;
2717
2367
  onStreamAnimationComplete?: () => void;
@@ -2802,6 +2452,7 @@ export declare const IncomingMessageLayout: {
2802
2452
  onCancelForm?: (params: {
2803
2453
  key: string;
2804
2454
  }) => Promise<void>;
2455
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2805
2456
  onStreamAnimationStart?: () => void;
2806
2457
  onStreamAnimationProgress?: () => void;
2807
2458
  onStreamAnimationComplete?: () => void;
@@ -2829,6 +2480,9 @@ export declare const IncomingMessageLayout: {
2829
2480
  url: string;
2830
2481
  type: string;
2831
2482
  }) => void;
2483
+ onClickLink?: (params: {
2484
+ url: string;
2485
+ }) => void;
2832
2486
  children?: ReactNode;
2833
2487
  }) | ({
2834
2488
  messageType: "file";
@@ -2876,6 +2530,7 @@ export declare const IncomingMessageLayout: {
2876
2530
  onCancelForm?: (params: {
2877
2531
  key: string;
2878
2532
  }) => Promise<void>;
2533
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2879
2534
  onStreamAnimationStart?: () => void;
2880
2535
  onStreamAnimationProgress?: () => void;
2881
2536
  onStreamAnimationComplete?: () => void;
@@ -2903,6 +2558,9 @@ export declare const IncomingMessageLayout: {
2903
2558
  url: string;
2904
2559
  type: string;
2905
2560
  }) => void;
2561
+ onClickLink?: (params: {
2562
+ url: string;
2563
+ }) => void;
2906
2564
  children?: ReactNode;
2907
2565
  }) | ({
2908
2566
  messageType: "multipleFiles";
@@ -2950,6 +2608,7 @@ export declare const IncomingMessageLayout: {
2950
2608
  onCancelForm?: (params: {
2951
2609
  key: string;
2952
2610
  }) => Promise<void>;
2611
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2953
2612
  onStreamAnimationStart?: () => void;
2954
2613
  onStreamAnimationProgress?: () => void;
2955
2614
  onStreamAnimationComplete?: () => void;
@@ -2977,139 +2636,606 @@ export declare const IncomingMessageLayout: {
2977
2636
  url: string;
2978
2637
  type: string;
2979
2638
  }) => void;
2639
+ onClickLink?: (params: {
2640
+ url: string;
2641
+ }) => void;
2980
2642
  children?: ReactNode;
2981
2643
  })) => ReactNode;
2982
- CTAButton: ({ extendedMessagePayload, onClickCTA, }: IncomingMessageProps) => ReactNode;
2983
- Citation: ({ extendedMessagePayload, onClickCitation, }: IncomingMessageProps) => ReactNode;
2984
- Form: (props: IncomingMessageProps) => ReactNode;
2985
- Feedback: ({ isBotMessage, isConversationClosed, isStreaming, isFeedbackEnabled, isFeedbackCommentEnabled, extendedMessagePayload, onFeedbackUpdate, }: IncomingMessageProps) => ReactNode;
2986
- MessageLogs: (_: IncomingMessageProps) => ReactNode;
2987
- };
2988
- };
2989
- Template: ({ template, children }: {
2990
- template?: ComponentType<IncomingMessageTemplateProps> | undefined;
2991
- children?: ReactNode;
2992
- }) => JSX.Element;
2993
- Context: Context<LayoutContextValue<IncomingMessageTemplateProps, {
2994
- SenderName: ({ sender }: Pick<IncomingMessageProps, "sender">) => ReactNode;
2995
- SenderAvatar: ({ sender, isBotMessage, }: Pick<IncomingMessageProps, "sender" | "isBotMessage">) => ReactNode;
2996
- SentTime: ({ createdAt }: Pick<IncomingMessageProps, "createdAt">) => ReactNode;
2997
- MessageBody: (props: IncomingMessageBodyProps) => ReactNode;
2998
- TextMessageBody: typeof IncomingTextBody;
2999
- MediaMessageBody: typeof IncomingMediaBody;
3000
- FileMessageBody: typeof IncomingFileBody;
3001
- MultipleFilesMessageBody: ({ files, children, onClickMedia, onClickMediaFiles, }: IncomingMessageBodyProps<"multipleFiles">) => JSX.Element;
3002
- TypingIndicator: ({ thinkingMessage, customStyle }: IncomingMessageProps & {
3003
- customStyle?: {
3004
- bubbleContentColor?: string;
3005
- bubbleBackgroundColor?: string;
3006
- };
3007
- }) => ReactNode;
3008
- SuggestedReplies: ({ extendedMessagePayload, onClickSuggestedReply, suggestedRepliesDirection, }: IncomingMessageProps) => ReactNode;
3009
- MessageTemplate: (props: {
3010
- onGetCachedMessageTemplate?: ((templateKey: string) => string | null) | undefined;
3011
- onRequestMessageTemplate?: ((templateKey: string) => Promise<string>) | undefined;
3012
- onHandleTemplateInternalAction?: ((action: Action) => void) | undefined;
3013
- messageTemplateErrorFallback?: ReactNode;
3014
- messageTemplateLoadingFallback?: ReactNode;
3015
- extendedMessagePayload?: Partial<ExtendedMessagePayload> | undefined;
3016
- }) => ReactNode;
3017
- CustomMessageTemplate: (_: ({
3018
- messageType: "user";
3019
- message: string;
3020
- } & {
3021
- sender: {
3022
- nickname: string;
3023
- profileUrl?: string;
3024
- };
3025
- thinkingMessage?: string;
3026
- suggestedRepliesVisible?: boolean;
3027
- suggestedRepliesDirection?: "vertical" | "horizontal";
3028
- isBotMessage?: boolean;
3029
- isTyping?: boolean;
3030
- isStreaming?: boolean;
3031
- isHandedOff?: boolean;
3032
- isConversationClosed?: boolean;
3033
- isFeedbackEnabled?: boolean;
3034
- isFeedbackCommentEnabled?: boolean;
3035
- isSenderAvatarVisible?: boolean;
3036
- markdownImageRenderMode?: MarkdownImageRenderMode;
3037
- onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3038
- onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3039
- onHandleTemplateInternalAction?: (action: Action) => void;
3040
- onClickSuggestedReply?: (params: {
3041
- reply: string;
3042
- }) => void;
3043
- onClickCTA?: (params: {
3044
- url: string;
3045
- }) => void;
3046
- onClickCitation?: (citation: CitationInfo) => void;
3047
- onFeedbackUpdate?: (params: {
3048
- rating: "good" | "bad";
3049
- comment?: string;
3050
- } | null) => void;
3051
- onSubmitForm?: (params: {
3052
- key: string;
3053
- data: Record<string, FormFieldValue>;
3054
- }) => Promise<void>;
3055
- onCancelForm?: (params: {
3056
- key: string;
3057
- }) => Promise<void>;
3058
- onStreamAnimationStart?: () => void;
3059
- onStreamAnimationProgress?: () => void;
3060
- onStreamAnimationComplete?: () => void;
3061
- messageTemplateErrorFallback?: ReactNode;
3062
- messageTemplateLoadingFallback?: ReactNode;
3063
- } & {
3064
- data?: string;
3065
- createdAt?: number;
3066
- extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3067
- groupType?: MessageGroupType;
3068
- maxBodyWidth?: number;
3069
- onClickMedia?: (params: {
3070
- url: string;
3071
- type: string;
3072
- }) => void;
3073
- onClickMediaFiles?: (params: {
3074
- files: Array<{
3075
- url: string;
3076
- type: string;
3077
- name?: string;
3078
- }>;
3079
- index: number;
3080
- }) => void;
3081
- onClickFile?: (params: {
3082
- url: string;
3083
- type: string;
3084
- }) => void;
3085
- children?: ReactNode;
3086
- }) | ({
3087
- messageType: "file";
3088
- message: string;
3089
- file: {
3090
- type: string;
3091
- url: string;
3092
- name: string;
3093
- };
3094
- } & {
3095
- sender: {
3096
- nickname: string;
3097
- profileUrl?: string;
3098
- };
3099
- thinkingMessage?: string;
3100
- suggestedRepliesVisible?: boolean;
3101
- suggestedRepliesDirection?: "vertical" | "horizontal";
3102
- isBotMessage?: boolean;
3103
- isTyping?: boolean;
3104
- isStreaming?: boolean;
3105
- isHandedOff?: boolean;
3106
- isConversationClosed?: boolean;
3107
- isFeedbackEnabled?: boolean;
3108
- isFeedbackCommentEnabled?: boolean;
3109
- isSenderAvatarVisible?: boolean;
3110
- markdownImageRenderMode?: MarkdownImageRenderMode;
3111
- onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3112
- onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2644
+ Challenge: (_: ({
2645
+ messageType: "user";
2646
+ message: string;
2647
+ } & {
2648
+ sender: {
2649
+ nickname: string;
2650
+ profileUrl?: string;
2651
+ };
2652
+ thinkingMessage?: string;
2653
+ suggestedRepliesVisible?: boolean;
2654
+ suggestedRepliesDirection?: "vertical" | "horizontal";
2655
+ isBotMessage?: boolean;
2656
+ isTyping?: boolean;
2657
+ isStreaming?: boolean;
2658
+ isHandedOff?: boolean;
2659
+ isConversationClosed?: boolean;
2660
+ isFeedbackEnabled?: boolean;
2661
+ isFeedbackCommentEnabled?: boolean;
2662
+ isSenderAvatarVisible?: boolean;
2663
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2664
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2665
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2666
+ onHandleTemplateInternalAction?: (action: Action) => void;
2667
+ onClickSuggestedReply?: (params: {
2668
+ reply: string;
2669
+ }) => void;
2670
+ onClickCTA?: (params: {
2671
+ url: string;
2672
+ }) => void;
2673
+ onClickCitation?: (citation: CitationInfo) => void;
2674
+ onFeedbackUpdate?: (params: {
2675
+ rating: "good" | "bad";
2676
+ comment?: string;
2677
+ } | null) => void;
2678
+ onSubmitForm?: (params: {
2679
+ key: string;
2680
+ data: Record<string, FormFieldValue>;
2681
+ }) => Promise<void>;
2682
+ onCancelForm?: (params: {
2683
+ key: string;
2684
+ }) => Promise<void>;
2685
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2686
+ onStreamAnimationStart?: () => void;
2687
+ onStreamAnimationProgress?: () => void;
2688
+ onStreamAnimationComplete?: () => void;
2689
+ messageTemplateErrorFallback?: ReactNode;
2690
+ messageTemplateLoadingFallback?: ReactNode;
2691
+ } & {
2692
+ data?: string;
2693
+ createdAt?: number;
2694
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
2695
+ groupType?: MessageGroupType;
2696
+ maxBodyWidth?: number;
2697
+ onClickMedia?: (params: {
2698
+ url: string;
2699
+ type: string;
2700
+ }) => void;
2701
+ onClickMediaFiles?: (params: {
2702
+ files: Array<{
2703
+ url: string;
2704
+ type: string;
2705
+ name?: string;
2706
+ }>;
2707
+ index: number;
2708
+ }) => void;
2709
+ onClickFile?: (params: {
2710
+ url: string;
2711
+ type: string;
2712
+ }) => void;
2713
+ onClickLink?: (params: {
2714
+ url: string;
2715
+ }) => void;
2716
+ children?: ReactNode;
2717
+ }) | ({
2718
+ messageType: "file";
2719
+ message: string;
2720
+ file: {
2721
+ type: string;
2722
+ url: string;
2723
+ name: string;
2724
+ };
2725
+ } & {
2726
+ sender: {
2727
+ nickname: string;
2728
+ profileUrl?: string;
2729
+ };
2730
+ thinkingMessage?: string;
2731
+ suggestedRepliesVisible?: boolean;
2732
+ suggestedRepliesDirection?: "vertical" | "horizontal";
2733
+ isBotMessage?: boolean;
2734
+ isTyping?: boolean;
2735
+ isStreaming?: boolean;
2736
+ isHandedOff?: boolean;
2737
+ isConversationClosed?: boolean;
2738
+ isFeedbackEnabled?: boolean;
2739
+ isFeedbackCommentEnabled?: boolean;
2740
+ isSenderAvatarVisible?: boolean;
2741
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2742
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2743
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2744
+ onHandleTemplateInternalAction?: (action: Action) => void;
2745
+ onClickSuggestedReply?: (params: {
2746
+ reply: string;
2747
+ }) => void;
2748
+ onClickCTA?: (params: {
2749
+ url: string;
2750
+ }) => void;
2751
+ onClickCitation?: (citation: CitationInfo) => void;
2752
+ onFeedbackUpdate?: (params: {
2753
+ rating: "good" | "bad";
2754
+ comment?: string;
2755
+ } | null) => void;
2756
+ onSubmitForm?: (params: {
2757
+ key: string;
2758
+ data: Record<string, FormFieldValue>;
2759
+ }) => Promise<void>;
2760
+ onCancelForm?: (params: {
2761
+ key: string;
2762
+ }) => Promise<void>;
2763
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2764
+ onStreamAnimationStart?: () => void;
2765
+ onStreamAnimationProgress?: () => void;
2766
+ onStreamAnimationComplete?: () => void;
2767
+ messageTemplateErrorFallback?: ReactNode;
2768
+ messageTemplateLoadingFallback?: ReactNode;
2769
+ } & {
2770
+ data?: string;
2771
+ createdAt?: number;
2772
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
2773
+ groupType?: MessageGroupType;
2774
+ maxBodyWidth?: number;
2775
+ onClickMedia?: (params: {
2776
+ url: string;
2777
+ type: string;
2778
+ }) => void;
2779
+ onClickMediaFiles?: (params: {
2780
+ files: Array<{
2781
+ url: string;
2782
+ type: string;
2783
+ name?: string;
2784
+ }>;
2785
+ index: number;
2786
+ }) => void;
2787
+ onClickFile?: (params: {
2788
+ url: string;
2789
+ type: string;
2790
+ }) => void;
2791
+ onClickLink?: (params: {
2792
+ url: string;
2793
+ }) => void;
2794
+ children?: ReactNode;
2795
+ }) | ({
2796
+ messageType: "multipleFiles";
2797
+ message: string;
2798
+ files: {
2799
+ type: string;
2800
+ url: string;
2801
+ name: string;
2802
+ }[];
2803
+ } & {
2804
+ sender: {
2805
+ nickname: string;
2806
+ profileUrl?: string;
2807
+ };
2808
+ thinkingMessage?: string;
2809
+ suggestedRepliesVisible?: boolean;
2810
+ suggestedRepliesDirection?: "vertical" | "horizontal";
2811
+ isBotMessage?: boolean;
2812
+ isTyping?: boolean;
2813
+ isStreaming?: boolean;
2814
+ isHandedOff?: boolean;
2815
+ isConversationClosed?: boolean;
2816
+ isFeedbackEnabled?: boolean;
2817
+ isFeedbackCommentEnabled?: boolean;
2818
+ isSenderAvatarVisible?: boolean;
2819
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2820
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2821
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2822
+ onHandleTemplateInternalAction?: (action: Action) => void;
2823
+ onClickSuggestedReply?: (params: {
2824
+ reply: string;
2825
+ }) => void;
2826
+ onClickCTA?: (params: {
2827
+ url: string;
2828
+ }) => void;
2829
+ onClickCitation?: (citation: CitationInfo) => void;
2830
+ onFeedbackUpdate?: (params: {
2831
+ rating: "good" | "bad";
2832
+ comment?: string;
2833
+ } | null) => void;
2834
+ onSubmitForm?: (params: {
2835
+ key: string;
2836
+ data: Record<string, FormFieldValue>;
2837
+ }) => Promise<void>;
2838
+ onCancelForm?: (params: {
2839
+ key: string;
2840
+ }) => Promise<void>;
2841
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2842
+ onStreamAnimationStart?: () => void;
2843
+ onStreamAnimationProgress?: () => void;
2844
+ onStreamAnimationComplete?: () => void;
2845
+ messageTemplateErrorFallback?: ReactNode;
2846
+ messageTemplateLoadingFallback?: ReactNode;
2847
+ } & {
2848
+ data?: string;
2849
+ createdAt?: number;
2850
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
2851
+ groupType?: MessageGroupType;
2852
+ maxBodyWidth?: number;
2853
+ onClickMedia?: (params: {
2854
+ url: string;
2855
+ type: string;
2856
+ }) => void;
2857
+ onClickMediaFiles?: (params: {
2858
+ files: Array<{
2859
+ url: string;
2860
+ type: string;
2861
+ name?: string;
2862
+ }>;
2863
+ index: number;
2864
+ }) => void;
2865
+ onClickFile?: (params: {
2866
+ url: string;
2867
+ type: string;
2868
+ }) => void;
2869
+ onClickLink?: (params: {
2870
+ url: string;
2871
+ }) => void;
2872
+ children?: ReactNode;
2873
+ })) => ReactNode;
2874
+ CTAButton: ({ extendedMessagePayload, onClickCTA, }: IncomingMessageProps) => ReactNode;
2875
+ Citation: ({ extendedMessagePayload, onClickCitation, }: IncomingMessageProps) => ReactNode;
2876
+ Form: (props: IncomingMessageProps) => ReactNode;
2877
+ Feedback: ({ isBotMessage, isConversationClosed, isStreaming, isFeedbackEnabled, isFeedbackCommentEnabled, extendedMessagePayload, onFeedbackUpdate, }: IncomingMessageProps) => ReactNode;
2878
+ MessageLogs: (_: IncomingMessageProps) => ReactNode;
2879
+ };
2880
+ };
2881
+ Template: ({ template, children }: {
2882
+ template?: ComponentType<IncomingMessageTemplateProps> | undefined;
2883
+ children?: ReactNode;
2884
+ }) => JSX.Element;
2885
+ Context: Context<LayoutContextValue<IncomingMessageTemplateProps, {
2886
+ SenderName: ({ sender }: Pick<IncomingMessageProps, "sender">) => ReactNode;
2887
+ SenderAvatar: ({ sender, isBotMessage, }: Pick<IncomingMessageProps, "sender" | "isBotMessage">) => ReactNode;
2888
+ SentTime: ({ createdAt }: Pick<IncomingMessageProps, "createdAt">) => ReactNode;
2889
+ MessageBody: (props: IncomingMessageBodyProps) => ReactNode;
2890
+ TextMessageBody: typeof IncomingTextBody;
2891
+ MediaMessageBody: typeof IncomingMediaBody;
2892
+ FileMessageBody: typeof IncomingFileBody;
2893
+ MultipleFilesMessageBody: ({ files, children, onClickMedia, onClickMediaFiles, }: IncomingMessageBodyProps<"multipleFiles">) => JSX.Element;
2894
+ TypingIndicator: ({ thinkingMessage, customStyle }: IncomingMessageProps & {
2895
+ customStyle?: {
2896
+ bubbleContentColor?: string;
2897
+ bubbleBackgroundColor?: string;
2898
+ };
2899
+ }) => ReactNode;
2900
+ SuggestedReplies: ({ extendedMessagePayload, onClickSuggestedReply, suggestedRepliesDirection, }: IncomingMessageProps) => ReactNode;
2901
+ MessageTemplate: (props: {
2902
+ onGetCachedMessageTemplate?: ((templateKey: string) => string | null) | undefined;
2903
+ onRequestMessageTemplate?: ((templateKey: string) => Promise<string>) | undefined;
2904
+ onHandleTemplateInternalAction?: ((action: Action) => void) | undefined;
2905
+ messageTemplateErrorFallback?: ReactNode;
2906
+ messageTemplateLoadingFallback?: ReactNode;
2907
+ extendedMessagePayload?: Partial<ExtendedMessagePayload> | undefined;
2908
+ }) => ReactNode;
2909
+ CustomMessageTemplate: (_: ({
2910
+ messageType: "user";
2911
+ message: string;
2912
+ } & {
2913
+ sender: {
2914
+ nickname: string;
2915
+ profileUrl?: string;
2916
+ };
2917
+ thinkingMessage?: string;
2918
+ suggestedRepliesVisible?: boolean;
2919
+ suggestedRepliesDirection?: "vertical" | "horizontal";
2920
+ isBotMessage?: boolean;
2921
+ isTyping?: boolean;
2922
+ isStreaming?: boolean;
2923
+ isHandedOff?: boolean;
2924
+ isConversationClosed?: boolean;
2925
+ isFeedbackEnabled?: boolean;
2926
+ isFeedbackCommentEnabled?: boolean;
2927
+ isSenderAvatarVisible?: boolean;
2928
+ markdownImageRenderMode?: MarkdownImageRenderMode;
2929
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
2930
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
2931
+ onHandleTemplateInternalAction?: (action: Action) => void;
2932
+ onClickSuggestedReply?: (params: {
2933
+ reply: string;
2934
+ }) => void;
2935
+ onClickCTA?: (params: {
2936
+ url: string;
2937
+ }) => void;
2938
+ onClickCitation?: (citation: CitationInfo) => void;
2939
+ onFeedbackUpdate?: (params: {
2940
+ rating: "good" | "bad";
2941
+ comment?: string;
2942
+ } | null) => void;
2943
+ onSubmitForm?: (params: {
2944
+ key: string;
2945
+ data: Record<string, FormFieldValue>;
2946
+ }) => Promise<void>;
2947
+ onCancelForm?: (params: {
2948
+ key: string;
2949
+ }) => Promise<void>;
2950
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
2951
+ onStreamAnimationStart?: () => void;
2952
+ onStreamAnimationProgress?: () => void;
2953
+ onStreamAnimationComplete?: () => void;
2954
+ messageTemplateErrorFallback?: ReactNode;
2955
+ messageTemplateLoadingFallback?: ReactNode;
2956
+ } & {
2957
+ data?: string;
2958
+ createdAt?: number;
2959
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
2960
+ groupType?: MessageGroupType;
2961
+ maxBodyWidth?: number;
2962
+ onClickMedia?: (params: {
2963
+ url: string;
2964
+ type: string;
2965
+ }) => void;
2966
+ onClickMediaFiles?: (params: {
2967
+ files: Array<{
2968
+ url: string;
2969
+ type: string;
2970
+ name?: string;
2971
+ }>;
2972
+ index: number;
2973
+ }) => void;
2974
+ onClickFile?: (params: {
2975
+ url: string;
2976
+ type: string;
2977
+ }) => void;
2978
+ onClickLink?: (params: {
2979
+ url: string;
2980
+ }) => void;
2981
+ children?: ReactNode;
2982
+ }) | ({
2983
+ messageType: "file";
2984
+ message: string;
2985
+ file: {
2986
+ type: string;
2987
+ url: string;
2988
+ name: string;
2989
+ };
2990
+ } & {
2991
+ sender: {
2992
+ nickname: string;
2993
+ profileUrl?: string;
2994
+ };
2995
+ thinkingMessage?: string;
2996
+ suggestedRepliesVisible?: boolean;
2997
+ suggestedRepliesDirection?: "vertical" | "horizontal";
2998
+ isBotMessage?: boolean;
2999
+ isTyping?: boolean;
3000
+ isStreaming?: boolean;
3001
+ isHandedOff?: boolean;
3002
+ isConversationClosed?: boolean;
3003
+ isFeedbackEnabled?: boolean;
3004
+ isFeedbackCommentEnabled?: boolean;
3005
+ isSenderAvatarVisible?: boolean;
3006
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3007
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3008
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3009
+ onHandleTemplateInternalAction?: (action: Action) => void;
3010
+ onClickSuggestedReply?: (params: {
3011
+ reply: string;
3012
+ }) => void;
3013
+ onClickCTA?: (params: {
3014
+ url: string;
3015
+ }) => void;
3016
+ onClickCitation?: (citation: CitationInfo) => void;
3017
+ onFeedbackUpdate?: (params: {
3018
+ rating: "good" | "bad";
3019
+ comment?: string;
3020
+ } | null) => void;
3021
+ onSubmitForm?: (params: {
3022
+ key: string;
3023
+ data: Record<string, FormFieldValue>;
3024
+ }) => Promise<void>;
3025
+ onCancelForm?: (params: {
3026
+ key: string;
3027
+ }) => Promise<void>;
3028
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3029
+ onStreamAnimationStart?: () => void;
3030
+ onStreamAnimationProgress?: () => void;
3031
+ onStreamAnimationComplete?: () => void;
3032
+ messageTemplateErrorFallback?: ReactNode;
3033
+ messageTemplateLoadingFallback?: ReactNode;
3034
+ } & {
3035
+ data?: string;
3036
+ createdAt?: number;
3037
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3038
+ groupType?: MessageGroupType;
3039
+ maxBodyWidth?: number;
3040
+ onClickMedia?: (params: {
3041
+ url: string;
3042
+ type: string;
3043
+ }) => void;
3044
+ onClickMediaFiles?: (params: {
3045
+ files: Array<{
3046
+ url: string;
3047
+ type: string;
3048
+ name?: string;
3049
+ }>;
3050
+ index: number;
3051
+ }) => void;
3052
+ onClickFile?: (params: {
3053
+ url: string;
3054
+ type: string;
3055
+ }) => void;
3056
+ onClickLink?: (params: {
3057
+ url: string;
3058
+ }) => void;
3059
+ children?: ReactNode;
3060
+ }) | ({
3061
+ messageType: "multipleFiles";
3062
+ message: string;
3063
+ files: {
3064
+ type: string;
3065
+ url: string;
3066
+ name: string;
3067
+ }[];
3068
+ } & {
3069
+ sender: {
3070
+ nickname: string;
3071
+ profileUrl?: string;
3072
+ };
3073
+ thinkingMessage?: string;
3074
+ suggestedRepliesVisible?: boolean;
3075
+ suggestedRepliesDirection?: "vertical" | "horizontal";
3076
+ isBotMessage?: boolean;
3077
+ isTyping?: boolean;
3078
+ isStreaming?: boolean;
3079
+ isHandedOff?: boolean;
3080
+ isConversationClosed?: boolean;
3081
+ isFeedbackEnabled?: boolean;
3082
+ isFeedbackCommentEnabled?: boolean;
3083
+ isSenderAvatarVisible?: boolean;
3084
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3085
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3086
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3087
+ onHandleTemplateInternalAction?: (action: Action) => void;
3088
+ onClickSuggestedReply?: (params: {
3089
+ reply: string;
3090
+ }) => void;
3091
+ onClickCTA?: (params: {
3092
+ url: string;
3093
+ }) => void;
3094
+ onClickCitation?: (citation: CitationInfo) => void;
3095
+ onFeedbackUpdate?: (params: {
3096
+ rating: "good" | "bad";
3097
+ comment?: string;
3098
+ } | null) => void;
3099
+ onSubmitForm?: (params: {
3100
+ key: string;
3101
+ data: Record<string, FormFieldValue>;
3102
+ }) => Promise<void>;
3103
+ onCancelForm?: (params: {
3104
+ key: string;
3105
+ }) => Promise<void>;
3106
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3107
+ onStreamAnimationStart?: () => void;
3108
+ onStreamAnimationProgress?: () => void;
3109
+ onStreamAnimationComplete?: () => void;
3110
+ messageTemplateErrorFallback?: ReactNode;
3111
+ messageTemplateLoadingFallback?: ReactNode;
3112
+ } & {
3113
+ data?: string;
3114
+ createdAt?: number;
3115
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3116
+ groupType?: MessageGroupType;
3117
+ maxBodyWidth?: number;
3118
+ onClickMedia?: (params: {
3119
+ url: string;
3120
+ type: string;
3121
+ }) => void;
3122
+ onClickMediaFiles?: (params: {
3123
+ files: Array<{
3124
+ url: string;
3125
+ type: string;
3126
+ name?: string;
3127
+ }>;
3128
+ index: number;
3129
+ }) => void;
3130
+ onClickFile?: (params: {
3131
+ url: string;
3132
+ type: string;
3133
+ }) => void;
3134
+ onClickLink?: (params: {
3135
+ url: string;
3136
+ }) => void;
3137
+ children?: ReactNode;
3138
+ })) => ReactNode;
3139
+ Challenge: (_: ({
3140
+ messageType: "user";
3141
+ message: string;
3142
+ } & {
3143
+ sender: {
3144
+ nickname: string;
3145
+ profileUrl?: string;
3146
+ };
3147
+ thinkingMessage?: string;
3148
+ suggestedRepliesVisible?: boolean;
3149
+ suggestedRepliesDirection?: "vertical" | "horizontal";
3150
+ isBotMessage?: boolean;
3151
+ isTyping?: boolean;
3152
+ isStreaming?: boolean;
3153
+ isHandedOff?: boolean;
3154
+ isConversationClosed?: boolean;
3155
+ isFeedbackEnabled?: boolean;
3156
+ isFeedbackCommentEnabled?: boolean;
3157
+ isSenderAvatarVisible?: boolean;
3158
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3159
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3160
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3161
+ onHandleTemplateInternalAction?: (action: Action) => void;
3162
+ onClickSuggestedReply?: (params: {
3163
+ reply: string;
3164
+ }) => void;
3165
+ onClickCTA?: (params: {
3166
+ url: string;
3167
+ }) => void;
3168
+ onClickCitation?: (citation: CitationInfo) => void;
3169
+ onFeedbackUpdate?: (params: {
3170
+ rating: "good" | "bad";
3171
+ comment?: string;
3172
+ } | null) => void;
3173
+ onSubmitForm?: (params: {
3174
+ key: string;
3175
+ data: Record<string, FormFieldValue>;
3176
+ }) => Promise<void>;
3177
+ onCancelForm?: (params: {
3178
+ key: string;
3179
+ }) => Promise<void>;
3180
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3181
+ onStreamAnimationStart?: () => void;
3182
+ onStreamAnimationProgress?: () => void;
3183
+ onStreamAnimationComplete?: () => void;
3184
+ messageTemplateErrorFallback?: ReactNode;
3185
+ messageTemplateLoadingFallback?: ReactNode;
3186
+ } & {
3187
+ data?: string;
3188
+ createdAt?: number;
3189
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3190
+ groupType?: MessageGroupType;
3191
+ maxBodyWidth?: number;
3192
+ onClickMedia?: (params: {
3193
+ url: string;
3194
+ type: string;
3195
+ }) => void;
3196
+ onClickMediaFiles?: (params: {
3197
+ files: Array<{
3198
+ url: string;
3199
+ type: string;
3200
+ name?: string;
3201
+ }>;
3202
+ index: number;
3203
+ }) => void;
3204
+ onClickFile?: (params: {
3205
+ url: string;
3206
+ type: string;
3207
+ }) => void;
3208
+ onClickLink?: (params: {
3209
+ url: string;
3210
+ }) => void;
3211
+ children?: ReactNode;
3212
+ }) | ({
3213
+ messageType: "file";
3214
+ message: string;
3215
+ file: {
3216
+ type: string;
3217
+ url: string;
3218
+ name: string;
3219
+ };
3220
+ } & {
3221
+ sender: {
3222
+ nickname: string;
3223
+ profileUrl?: string;
3224
+ };
3225
+ thinkingMessage?: string;
3226
+ suggestedRepliesVisible?: boolean;
3227
+ suggestedRepliesDirection?: "vertical" | "horizontal";
3228
+ isBotMessage?: boolean;
3229
+ isTyping?: boolean;
3230
+ isStreaming?: boolean;
3231
+ isHandedOff?: boolean;
3232
+ isConversationClosed?: boolean;
3233
+ isFeedbackEnabled?: boolean;
3234
+ isFeedbackCommentEnabled?: boolean;
3235
+ isSenderAvatarVisible?: boolean;
3236
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3237
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3238
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3113
3239
  onHandleTemplateInternalAction?: (action: Action) => void;
3114
3240
  onClickSuggestedReply?: (params: {
3115
3241
  reply: string;
@@ -3129,6 +3255,7 @@ export declare const IncomingMessageLayout: {
3129
3255
  onCancelForm?: (params: {
3130
3256
  key: string;
3131
3257
  }) => Promise<void>;
3258
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3132
3259
  onStreamAnimationStart?: () => void;
3133
3260
  onStreamAnimationProgress?: () => void;
3134
3261
  onStreamAnimationComplete?: () => void;
@@ -3156,6 +3283,9 @@ export declare const IncomingMessageLayout: {
3156
3283
  url: string;
3157
3284
  type: string;
3158
3285
  }) => void;
3286
+ onClickLink?: (params: {
3287
+ url: string;
3288
+ }) => void;
3159
3289
  children?: ReactNode;
3160
3290
  }) | ({
3161
3291
  messageType: "multipleFiles";
@@ -3203,6 +3333,7 @@ export declare const IncomingMessageLayout: {
3203
3333
  onCancelForm?: (params: {
3204
3334
  key: string;
3205
3335
  }) => Promise<void>;
3336
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3206
3337
  onStreamAnimationStart?: () => void;
3207
3338
  onStreamAnimationProgress?: () => void;
3208
3339
  onStreamAnimationComplete?: () => void;
@@ -3230,6 +3361,9 @@ export declare const IncomingMessageLayout: {
3230
3361
  url: string;
3231
3362
  type: string;
3232
3363
  }) => void;
3364
+ onClickLink?: (params: {
3365
+ url: string;
3366
+ }) => void;
3233
3367
  children?: ReactNode;
3234
3368
  })) => ReactNode;
3235
3369
  CTAButton: ({ extendedMessagePayload, onClickCTA, }: IncomingMessageProps) => ReactNode;
@@ -3303,6 +3437,237 @@ export declare const IncomingMessageLayout: {
3303
3437
  onCancelForm?: (params: {
3304
3438
  key: string;
3305
3439
  }) => Promise<void>;
3440
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3441
+ onStreamAnimationStart?: () => void;
3442
+ onStreamAnimationProgress?: () => void;
3443
+ onStreamAnimationComplete?: () => void;
3444
+ messageTemplateErrorFallback?: ReactNode;
3445
+ messageTemplateLoadingFallback?: ReactNode;
3446
+ } & {
3447
+ data?: string;
3448
+ createdAt?: number;
3449
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3450
+ groupType?: MessageGroupType;
3451
+ maxBodyWidth?: number;
3452
+ onClickMedia?: (params: {
3453
+ url: string;
3454
+ type: string;
3455
+ }) => void;
3456
+ onClickMediaFiles?: (params: {
3457
+ files: Array<{
3458
+ url: string;
3459
+ type: string;
3460
+ name?: string;
3461
+ }>;
3462
+ index: number;
3463
+ }) => void;
3464
+ onClickFile?: (params: {
3465
+ url: string;
3466
+ type: string;
3467
+ }) => void;
3468
+ onClickLink?: (params: {
3469
+ url: string;
3470
+ }) => void;
3471
+ children?: ReactNode;
3472
+ }) | ({
3473
+ messageType: "file";
3474
+ message: string;
3475
+ file: {
3476
+ type: string;
3477
+ url: string;
3478
+ name: string;
3479
+ };
3480
+ } & {
3481
+ sender: {
3482
+ nickname: string;
3483
+ profileUrl?: string;
3484
+ };
3485
+ thinkingMessage?: string;
3486
+ suggestedRepliesVisible?: boolean;
3487
+ suggestedRepliesDirection?: "vertical" | "horizontal";
3488
+ isBotMessage?: boolean;
3489
+ isTyping?: boolean;
3490
+ isStreaming?: boolean;
3491
+ isHandedOff?: boolean;
3492
+ isConversationClosed?: boolean;
3493
+ isFeedbackEnabled?: boolean;
3494
+ isFeedbackCommentEnabled?: boolean;
3495
+ isSenderAvatarVisible?: boolean;
3496
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3497
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3498
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3499
+ onHandleTemplateInternalAction?: (action: Action) => void;
3500
+ onClickSuggestedReply?: (params: {
3501
+ reply: string;
3502
+ }) => void;
3503
+ onClickCTA?: (params: {
3504
+ url: string;
3505
+ }) => void;
3506
+ onClickCitation?: (citation: CitationInfo) => void;
3507
+ onFeedbackUpdate?: (params: {
3508
+ rating: "good" | "bad";
3509
+ comment?: string;
3510
+ } | null) => void;
3511
+ onSubmitForm?: (params: {
3512
+ key: string;
3513
+ data: Record<string, FormFieldValue>;
3514
+ }) => Promise<void>;
3515
+ onCancelForm?: (params: {
3516
+ key: string;
3517
+ }) => Promise<void>;
3518
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3519
+ onStreamAnimationStart?: () => void;
3520
+ onStreamAnimationProgress?: () => void;
3521
+ onStreamAnimationComplete?: () => void;
3522
+ messageTemplateErrorFallback?: ReactNode;
3523
+ messageTemplateLoadingFallback?: ReactNode;
3524
+ } & {
3525
+ data?: string;
3526
+ createdAt?: number;
3527
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3528
+ groupType?: MessageGroupType;
3529
+ maxBodyWidth?: number;
3530
+ onClickMedia?: (params: {
3531
+ url: string;
3532
+ type: string;
3533
+ }) => void;
3534
+ onClickMediaFiles?: (params: {
3535
+ files: Array<{
3536
+ url: string;
3537
+ type: string;
3538
+ name?: string;
3539
+ }>;
3540
+ index: number;
3541
+ }) => void;
3542
+ onClickFile?: (params: {
3543
+ url: string;
3544
+ type: string;
3545
+ }) => void;
3546
+ onClickLink?: (params: {
3547
+ url: string;
3548
+ }) => void;
3549
+ children?: ReactNode;
3550
+ }) | ({
3551
+ messageType: "multipleFiles";
3552
+ message: string;
3553
+ files: {
3554
+ type: string;
3555
+ url: string;
3556
+ name: string;
3557
+ }[];
3558
+ } & {
3559
+ sender: {
3560
+ nickname: string;
3561
+ profileUrl?: string;
3562
+ };
3563
+ thinkingMessage?: string;
3564
+ suggestedRepliesVisible?: boolean;
3565
+ suggestedRepliesDirection?: "vertical" | "horizontal";
3566
+ isBotMessage?: boolean;
3567
+ isTyping?: boolean;
3568
+ isStreaming?: boolean;
3569
+ isHandedOff?: boolean;
3570
+ isConversationClosed?: boolean;
3571
+ isFeedbackEnabled?: boolean;
3572
+ isFeedbackCommentEnabled?: boolean;
3573
+ isSenderAvatarVisible?: boolean;
3574
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3575
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3576
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3577
+ onHandleTemplateInternalAction?: (action: Action) => void;
3578
+ onClickSuggestedReply?: (params: {
3579
+ reply: string;
3580
+ }) => void;
3581
+ onClickCTA?: (params: {
3582
+ url: string;
3583
+ }) => void;
3584
+ onClickCitation?: (citation: CitationInfo) => void;
3585
+ onFeedbackUpdate?: (params: {
3586
+ rating: "good" | "bad";
3587
+ comment?: string;
3588
+ } | null) => void;
3589
+ onSubmitForm?: (params: {
3590
+ key: string;
3591
+ data: Record<string, FormFieldValue>;
3592
+ }) => Promise<void>;
3593
+ onCancelForm?: (params: {
3594
+ key: string;
3595
+ }) => Promise<void>;
3596
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3597
+ onStreamAnimationStart?: () => void;
3598
+ onStreamAnimationProgress?: () => void;
3599
+ onStreamAnimationComplete?: () => void;
3600
+ messageTemplateErrorFallback?: ReactNode;
3601
+ messageTemplateLoadingFallback?: ReactNode;
3602
+ } & {
3603
+ data?: string;
3604
+ createdAt?: number;
3605
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3606
+ groupType?: MessageGroupType;
3607
+ maxBodyWidth?: number;
3608
+ onClickMedia?: (params: {
3609
+ url: string;
3610
+ type: string;
3611
+ }) => void;
3612
+ onClickMediaFiles?: (params: {
3613
+ files: Array<{
3614
+ url: string;
3615
+ type: string;
3616
+ name?: string;
3617
+ }>;
3618
+ index: number;
3619
+ }) => void;
3620
+ onClickFile?: (params: {
3621
+ url: string;
3622
+ type: string;
3623
+ }) => void;
3624
+ onClickLink?: (params: {
3625
+ url: string;
3626
+ }) => void;
3627
+ children?: ReactNode;
3628
+ })) => ReactNode;
3629
+ Challenge: (_: ({
3630
+ messageType: "user";
3631
+ message: string;
3632
+ } & {
3633
+ sender: {
3634
+ nickname: string;
3635
+ profileUrl?: string;
3636
+ };
3637
+ thinkingMessage?: string;
3638
+ suggestedRepliesVisible?: boolean;
3639
+ suggestedRepliesDirection?: "vertical" | "horizontal";
3640
+ isBotMessage?: boolean;
3641
+ isTyping?: boolean;
3642
+ isStreaming?: boolean;
3643
+ isHandedOff?: boolean;
3644
+ isConversationClosed?: boolean;
3645
+ isFeedbackEnabled?: boolean;
3646
+ isFeedbackCommentEnabled?: boolean;
3647
+ isSenderAvatarVisible?: boolean;
3648
+ markdownImageRenderMode?: MarkdownImageRenderMode;
3649
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
3650
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
3651
+ onHandleTemplateInternalAction?: (action: Action) => void;
3652
+ onClickSuggestedReply?: (params: {
3653
+ reply: string;
3654
+ }) => void;
3655
+ onClickCTA?: (params: {
3656
+ url: string;
3657
+ }) => void;
3658
+ onClickCitation?: (citation: CitationInfo) => void;
3659
+ onFeedbackUpdate?: (params: {
3660
+ rating: "good" | "bad";
3661
+ comment?: string;
3662
+ } | null) => void;
3663
+ onSubmitForm?: (params: {
3664
+ key: string;
3665
+ data: Record<string, FormFieldValue>;
3666
+ }) => Promise<void>;
3667
+ onCancelForm?: (params: {
3668
+ key: string;
3669
+ }) => Promise<void>;
3670
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3306
3671
  onStreamAnimationStart?: () => void;
3307
3672
  onStreamAnimationProgress?: () => void;
3308
3673
  onStreamAnimationComplete?: () => void;
@@ -3330,6 +3695,9 @@ export declare const IncomingMessageLayout: {
3330
3695
  url: string;
3331
3696
  type: string;
3332
3697
  }) => void;
3698
+ onClickLink?: (params: {
3699
+ url: string;
3700
+ }) => void;
3333
3701
  children?: ReactNode;
3334
3702
  }) | ({
3335
3703
  messageType: "file";
@@ -3377,6 +3745,7 @@ export declare const IncomingMessageLayout: {
3377
3745
  onCancelForm?: (params: {
3378
3746
  key: string;
3379
3747
  }) => Promise<void>;
3748
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3380
3749
  onStreamAnimationStart?: () => void;
3381
3750
  onStreamAnimationProgress?: () => void;
3382
3751
  onStreamAnimationComplete?: () => void;
@@ -3404,6 +3773,9 @@ export declare const IncomingMessageLayout: {
3404
3773
  url: string;
3405
3774
  type: string;
3406
3775
  }) => void;
3776
+ onClickLink?: (params: {
3777
+ url: string;
3778
+ }) => void;
3407
3779
  children?: ReactNode;
3408
3780
  }) | ({
3409
3781
  messageType: "multipleFiles";
@@ -3451,6 +3823,7 @@ export declare const IncomingMessageLayout: {
3451
3823
  onCancelForm?: (params: {
3452
3824
  key: string;
3453
3825
  }) => Promise<void>;
3826
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3454
3827
  onStreamAnimationStart?: () => void;
3455
3828
  onStreamAnimationProgress?: () => void;
3456
3829
  onStreamAnimationComplete?: () => void;
@@ -3478,6 +3851,9 @@ export declare const IncomingMessageLayout: {
3478
3851
  url: string;
3479
3852
  type: string;
3480
3853
  }) => void;
3854
+ onClickLink?: (params: {
3855
+ url: string;
3856
+ }) => void;
3481
3857
  children?: ReactNode;
3482
3858
  })) => ReactNode;
3483
3859
  CTAButton: ({ extendedMessagePayload, onClickCTA, }: IncomingMessageProps) => ReactNode;
@@ -3574,6 +3950,239 @@ export declare const IncomingMessageLayout: {
3574
3950
  onCancelForm?: (params: {
3575
3951
  key: string;
3576
3952
  }) => Promise<void>;
3953
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3954
+ onStreamAnimationStart?: () => void;
3955
+ onStreamAnimationProgress?: () => void;
3956
+ onStreamAnimationComplete?: () => void;
3957
+ messageTemplateErrorFallback?: ReactNode;
3958
+ messageTemplateLoadingFallback?: ReactNode;
3959
+ } & {
3960
+ data?: string;
3961
+ createdAt?: number;
3962
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
3963
+ groupType?: MessageGroupType;
3964
+ maxBodyWidth?: number;
3965
+ onClickMedia?: (params: {
3966
+ url: string;
3967
+ type: string;
3968
+ }) => void;
3969
+ onClickMediaFiles?: (params: {
3970
+ files: Array<{
3971
+ url: string;
3972
+ type: string;
3973
+ name?: string;
3974
+ }>;
3975
+ index: number;
3976
+ }) => void;
3977
+ onClickFile?: (params: {
3978
+ url: string;
3979
+ type: string;
3980
+ }) => void;
3981
+ onClickLink?: (params: {
3982
+ url: string;
3983
+ }) => void;
3984
+ children?: ReactNode;
3985
+ }) | ({
3986
+ messageType: "file";
3987
+ message: string;
3988
+ file: {
3989
+ type: string;
3990
+ url: string;
3991
+ name: string;
3992
+ };
3993
+ } & {
3994
+ sender: {
3995
+ nickname: string;
3996
+ profileUrl?: string;
3997
+ };
3998
+ thinkingMessage?: string;
3999
+ suggestedRepliesVisible?: boolean;
4000
+ suggestedRepliesDirection?: "vertical" | "horizontal";
4001
+ isBotMessage?: boolean;
4002
+ isTyping?: boolean;
4003
+ isStreaming?: boolean;
4004
+ isHandedOff?: boolean;
4005
+ isConversationClosed?: boolean;
4006
+ isFeedbackEnabled?: boolean;
4007
+ isFeedbackCommentEnabled?: boolean;
4008
+ isSenderAvatarVisible?: boolean;
4009
+ markdownImageRenderMode?: MarkdownImageRenderMode;
4010
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
4011
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
4012
+ onHandleTemplateInternalAction?: (action: Action) => void;
4013
+ onClickSuggestedReply?: (params: {
4014
+ reply: string;
4015
+ }) => void;
4016
+ onClickCTA?: (params: {
4017
+ url: string;
4018
+ }) => void;
4019
+ onClickCitation?: (citation: CitationInfo) => void;
4020
+ onFeedbackUpdate?: (params: {
4021
+ rating: "good" | "bad";
4022
+ comment?: string;
4023
+ } | null) => void;
4024
+ onSubmitForm?: (params: {
4025
+ key: string;
4026
+ data: Record<string, FormFieldValue>;
4027
+ }) => Promise<void>;
4028
+ onCancelForm?: (params: {
4029
+ key: string;
4030
+ }) => Promise<void>;
4031
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
4032
+ onStreamAnimationStart?: () => void;
4033
+ onStreamAnimationProgress?: () => void;
4034
+ onStreamAnimationComplete?: () => void;
4035
+ messageTemplateErrorFallback?: ReactNode;
4036
+ messageTemplateLoadingFallback?: ReactNode;
4037
+ } & {
4038
+ data?: string;
4039
+ createdAt?: number;
4040
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
4041
+ groupType?: MessageGroupType;
4042
+ maxBodyWidth?: number;
4043
+ onClickMedia?: (params: {
4044
+ url: string;
4045
+ type: string;
4046
+ }) => void;
4047
+ onClickMediaFiles?: (params: {
4048
+ files: Array<{
4049
+ url: string;
4050
+ type: string;
4051
+ name?: string;
4052
+ }>;
4053
+ index: number;
4054
+ }) => void;
4055
+ onClickFile?: (params: {
4056
+ url: string;
4057
+ type: string;
4058
+ }) => void;
4059
+ onClickLink?: (params: {
4060
+ url: string;
4061
+ }) => void;
4062
+ children?: ReactNode;
4063
+ }) | ({
4064
+ messageType: "multipleFiles";
4065
+ message: string;
4066
+ files: {
4067
+ type: string;
4068
+ url: string;
4069
+ name: string;
4070
+ }[];
4071
+ } & {
4072
+ sender: {
4073
+ nickname: string;
4074
+ profileUrl?: string;
4075
+ };
4076
+ thinkingMessage?: string;
4077
+ suggestedRepliesVisible?: boolean;
4078
+ suggestedRepliesDirection?: "vertical" | "horizontal";
4079
+ isBotMessage?: boolean;
4080
+ isTyping?: boolean;
4081
+ isStreaming?: boolean;
4082
+ isHandedOff?: boolean;
4083
+ isConversationClosed?: boolean;
4084
+ isFeedbackEnabled?: boolean;
4085
+ isFeedbackCommentEnabled?: boolean;
4086
+ isSenderAvatarVisible?: boolean;
4087
+ markdownImageRenderMode?: MarkdownImageRenderMode;
4088
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
4089
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
4090
+ onHandleTemplateInternalAction?: (action: Action) => void;
4091
+ onClickSuggestedReply?: (params: {
4092
+ reply: string;
4093
+ }) => void;
4094
+ onClickCTA?: (params: {
4095
+ url: string;
4096
+ }) => void;
4097
+ onClickCitation?: (citation: CitationInfo) => void;
4098
+ onFeedbackUpdate?: (params: {
4099
+ rating: "good" | "bad";
4100
+ comment?: string;
4101
+ } | null) => void;
4102
+ onSubmitForm?: (params: {
4103
+ key: string;
4104
+ data: Record<string, FormFieldValue>;
4105
+ }) => Promise<void>;
4106
+ onCancelForm?: (params: {
4107
+ key: string;
4108
+ }) => Promise<void>;
4109
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
4110
+ onStreamAnimationStart?: () => void;
4111
+ onStreamAnimationProgress?: () => void;
4112
+ onStreamAnimationComplete?: () => void;
4113
+ messageTemplateErrorFallback?: ReactNode;
4114
+ messageTemplateLoadingFallback?: ReactNode;
4115
+ } & {
4116
+ data?: string;
4117
+ createdAt?: number;
4118
+ extendedMessagePayload?: Partial<ExtendedMessagePayload>;
4119
+ groupType?: MessageGroupType;
4120
+ maxBodyWidth?: number;
4121
+ onClickMedia?: (params: {
4122
+ url: string;
4123
+ type: string;
4124
+ }) => void;
4125
+ onClickMediaFiles?: (params: {
4126
+ files: Array<{
4127
+ url: string;
4128
+ type: string;
4129
+ name?: string;
4130
+ }>;
4131
+ index: number;
4132
+ }) => void;
4133
+ onClickFile?: (params: {
4134
+ url: string;
4135
+ type: string;
4136
+ }) => void;
4137
+ onClickLink?: (params: {
4138
+ url: string;
4139
+ }) => void;
4140
+ children?: ReactNode;
4141
+ })) => ReactNode;
4142
+ }) => null;
4143
+ Challenge: (props: {
4144
+ component: (_: ({
4145
+ messageType: "user";
4146
+ message: string;
4147
+ } & {
4148
+ sender: {
4149
+ nickname: string;
4150
+ profileUrl?: string;
4151
+ };
4152
+ thinkingMessage?: string;
4153
+ suggestedRepliesVisible?: boolean;
4154
+ suggestedRepliesDirection?: "vertical" | "horizontal";
4155
+ isBotMessage?: boolean;
4156
+ isTyping?: boolean;
4157
+ isStreaming?: boolean;
4158
+ isHandedOff?: boolean;
4159
+ isConversationClosed?: boolean;
4160
+ isFeedbackEnabled?: boolean;
4161
+ isFeedbackCommentEnabled?: boolean;
4162
+ isSenderAvatarVisible?: boolean;
4163
+ markdownImageRenderMode?: MarkdownImageRenderMode;
4164
+ onGetCachedMessageTemplate?: (templateKey: string) => string | null;
4165
+ onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
4166
+ onHandleTemplateInternalAction?: (action: Action) => void;
4167
+ onClickSuggestedReply?: (params: {
4168
+ reply: string;
4169
+ }) => void;
4170
+ onClickCTA?: (params: {
4171
+ url: string;
4172
+ }) => void;
4173
+ onClickCitation?: (citation: CitationInfo) => void;
4174
+ onFeedbackUpdate?: (params: {
4175
+ rating: "good" | "bad";
4176
+ comment?: string;
4177
+ } | null) => void;
4178
+ onSubmitForm?: (params: {
4179
+ key: string;
4180
+ data: Record<string, FormFieldValue>;
4181
+ }) => Promise<void>;
4182
+ onCancelForm?: (params: {
4183
+ key: string;
4184
+ }) => Promise<void>;
4185
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3577
4186
  onStreamAnimationStart?: () => void;
3578
4187
  onStreamAnimationProgress?: () => void;
3579
4188
  onStreamAnimationComplete?: () => void;
@@ -3601,6 +4210,9 @@ export declare const IncomingMessageLayout: {
3601
4210
  url: string;
3602
4211
  type: string;
3603
4212
  }) => void;
4213
+ onClickLink?: (params: {
4214
+ url: string;
4215
+ }) => void;
3604
4216
  children?: ReactNode;
3605
4217
  }) | ({
3606
4218
  messageType: "file";
@@ -3648,6 +4260,7 @@ export declare const IncomingMessageLayout: {
3648
4260
  onCancelForm?: (params: {
3649
4261
  key: string;
3650
4262
  }) => Promise<void>;
4263
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3651
4264
  onStreamAnimationStart?: () => void;
3652
4265
  onStreamAnimationProgress?: () => void;
3653
4266
  onStreamAnimationComplete?: () => void;
@@ -3675,6 +4288,9 @@ export declare const IncomingMessageLayout: {
3675
4288
  url: string;
3676
4289
  type: string;
3677
4290
  }) => void;
4291
+ onClickLink?: (params: {
4292
+ url: string;
4293
+ }) => void;
3678
4294
  children?: ReactNode;
3679
4295
  }) | ({
3680
4296
  messageType: "multipleFiles";
@@ -3722,6 +4338,7 @@ export declare const IncomingMessageLayout: {
3722
4338
  onCancelForm?: (params: {
3723
4339
  key: string;
3724
4340
  }) => Promise<void>;
4341
+ onSendChallengeAction?: <T = object>(params: ChallengeActionParams) => Promise<T>;
3725
4342
  onStreamAnimationStart?: () => void;
3726
4343
  onStreamAnimationProgress?: () => void;
3727
4344
  onStreamAnimationComplete?: () => void;
@@ -3749,6 +4366,9 @@ export declare const IncomingMessageLayout: {
3749
4366
  url: string;
3750
4367
  type: string;
3751
4368
  }) => void;
4369
+ onClickLink?: (params: {
4370
+ url: string;
4371
+ }) => void;
3752
4372
  children?: ReactNode;
3753
4373
  })) => ReactNode;
3754
4374
  }) => null;
@@ -3828,7 +4448,7 @@ declare interface LanguageSet extends Omit<AIAgentLanguageSet, 'strings'> {
3828
4448
  stringSet: StringSet;
3829
4449
  }
3830
4450
 
3831
- export declare function LauncherBase({ className, children, isOpened, onClick, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, type, imageUrl, dir, animated, backgroundColor, size, }: LauncherProps): JSX.Element;
4451
+ export declare function LauncherBase({ className, children, isOpened, onClick, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, type, imageUrl, dir, animated, backgroundColor, size, hasUnread, }: LauncherProps): JSX.Element;
3832
4452
 
3833
4453
  declare type LauncherImageType = 'default_icon' | 'custom_image';
3834
4454
 
@@ -3850,6 +4470,7 @@ declare type LauncherProps = {
3850
4470
  animated?: boolean;
3851
4471
  dir?: 'ltr' | 'rtl';
3852
4472
  size?: number;
4473
+ hasUnread?: boolean;
3853
4474
  };
3854
4475
 
3855
4476
  declare interface LayoutContextValue<Props, Components extends Record<string, ComponentType<any>>> {
@@ -3980,7 +4601,7 @@ declare type MessageType_2 = OutgoingMessageProps['messageType'];
3980
4601
  declare interface MessengerContextValue extends AIAgentContextValue {
3981
4602
  rootElement: HTMLElement;
3982
4603
  agentPreviewConfigs?: AgentPreviewConfigs;
3983
- handlers?: AgentClientHandlers;
4604
+ handlers: ResolvedHandlers;
3984
4605
  state: {
3985
4606
  opened: boolean;
3986
4607
  setOpened: (value: boolean) => void;
@@ -4502,6 +5123,12 @@ declare type ReleaseDisabledByValue =
4502
5123
  | 'reconnecting'
4503
5124
  | 'handoff_pending';
4504
5125
 
5126
+ declare interface ResolvedHandlers extends AgentClientHandlers {
5127
+ onClickLink: (params: {
5128
+ url: string;
5129
+ }) => void;
5130
+ }
5131
+
4505
5132
  declare type SBUFoundationProps<T = NonNullable<unknown>> = T & {
4506
5133
  className?: string;
4507
5134
  children?: ReactNode;
@@ -4695,6 +5322,7 @@ declare type StringSet = {
4695
5322
  A11Y_CONVERSATION_CLOSED: string;
4696
5323
  A11Y_FILE_IMAGE: (name: string) => string;
4697
5324
  A11Y_FILE_VIDEO: (name: string) => string;
5325
+ A11Y_FILE_PDF: (name: string) => string;
4698
5326
  A11Y_FILE_DOCUMENT: (name: string) => string;
4699
5327
  A11Y_RECEIVED_FILE_IMAGE: string;
4700
5328
  A11Y_RECEIVED_FILE_VIDEO: string;
@@ -4836,11 +5464,6 @@ declare type TextField = {
4836
5464
  };
4837
5465
  };
4838
5466
 
4839
- declare interface ThrottledFunction<T extends (...args: any[]) => any> {
4840
- (...args: Parameters<T>): void;
4841
- cancel: () => void;
4842
- }
4843
-
4844
5467
  declare interface TimerData {
4845
5468
  startTime: number | null;
4846
5469
  endTime: number | null;