@sendbird/ai-agent-messenger-react 1.17.1-rc.0 → 1.19.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/cjs/{7XXWXLcU.cjs → B7RUkqyZ.cjs} +1 -1
- package/dist/cjs/{DQPi3fS8.cjs → BHmi862p.cjs} +1 -1
- package/dist/cjs/{BLuQkDcR.cjs → BRiNYhzZ.cjs} +1 -1
- package/dist/cjs/{B2hgrAGy.cjs → BWtj68w5.cjs} +1 -1
- package/dist/cjs/{CkMYduJm.cjs → ByGRYJVz.cjs} +1 -1
- package/dist/cjs/{BHbu2DmW.cjs → CDKvaFVD.cjs} +1 -1
- package/dist/cjs/{CwK6i9-r.cjs → CkRtPYu2.cjs} +1 -1
- package/dist/cjs/DmRtDiu3.cjs +330 -0
- package/dist/cjs/{OptTTWKD.cjs → Dn0HIoDs.cjs} +1 -1
- package/dist/cjs/{BztCzrYC.cjs → DuYQj-T9.cjs} +1 -1
- package/dist/cjs/{BTvjZpxU.cjs → KouyTorz.cjs} +1 -1
- package/dist/es/{DSF6suiF.js → BEvfkh3_.js} +1 -1
- package/dist/es/{Ciqor33y.js → C-dJq_hf.js} +1 -1
- package/dist/es/{dOjg_hmi.js → C4NDe7Wd.js} +1 -1
- package/dist/es/{CIfQGDUo.js → CWV-J3Ta.js} +1 -1
- package/dist/es/{BDacB7L5.js → Cmz3dl3b.js} +1 -1
- package/dist/es/{C66_3vse.js → DSsAaVrV.js} +1 -1
- package/dist/es/{BDbS-txF.js → Dqs_T84t.js} +1 -1
- package/dist/es/{CHuP5oSk.js → Pegg7Snc.js} +1 -1
- package/dist/es/{DKocG16I.js → cDVEvKPS.js} +2537 -2470
- package/dist/es/{tCCgN_1F.js → fyKo7Xbp.js} +1 -1
- package/dist/es/{Dig22Uld.js → kEl07Dux.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +23 -19
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/cjs/Bsj_CaE9.cjs +0 -330
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@sendbird/chat");const e=require("./cjs/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@sendbird/chat");const e=require("./cjs/DmRtDiu3.cjs");require("react");exports.AgentProviderContainer=e.AgentProviderContainer;exports.AgentUIProviderContainer=e.AgentUIProviderContainer;exports.AnonymousSessionInfo=e.AnonymousSessionInfo;exports.CSATType=e.CSATType;exports.Commands=e.DispatcherCommands;exports.Conversation=e.Conversation;exports.ConversationContext=e.ConversationContext;exports.ConversationContextProvider=e.ConversationContextProvider;exports.ConversationHeaderLayout=e.ConversationHeaderLayout;exports.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListContext=e.ConversationListContext;exports.ConversationListContextProvider=e.ConversationListContextProvider;exports.ConversationListHeaderLayout=e.ConversationListHeaderLayout;exports.ConversationListItemLayout=e.ConversationListItemLayout;exports.ConversationListLayout=e.ConversationListLayout;exports.DefaultMessenger=e.DefaultMessenger;exports.FixedMessenger=e.FixedMessenger;exports.IncomingMessageLayout=e.IncomingMessageLayout;exports.LauncherBase=e.LauncherBase;exports.LogLevel=e.LogLevel;exports.ManualSessionInfo=e.ManualSessionInfo;exports.MessageListUILayout=e.MessageListUILayout;exports.MessageLogs=e.MessageLogs;exports.OutgoingMessageLayout=e.OutgoingMessageLayout;exports.PlaceholderLayout=e.PlaceholderLayout;exports.SystemMessageLayout=e.SystemMessageLayout;exports.messengerDispatcher=e.messengerDispatcher;exports.useConversationContext=e.useConversationContext;exports.useConversationListContext=e.useConversationListContext;exports.useLocalizationContext=e.useLocalizationContext;exports.useMessengerContext=e.useMessengerContext;exports.useMessengerSessionContext=e.useMessengerSessionContext;exports.useRefreshActiveChannel=e.useRefreshActiveChannel;
|
package/dist/index.d.ts
CHANGED
|
@@ -271,10 +271,6 @@ origin?: string;
|
|
|
271
271
|
messageTemplate?: {
|
|
272
272
|
__internalVariables?: InternalMessageTemplateVariables;
|
|
273
273
|
};
|
|
274
|
-
/**
|
|
275
|
-
* @internal DO NOT USE THIS - Used for conversation initial render stat tracking.
|
|
276
|
-
*/
|
|
277
|
-
presentMethod?: PresentMethod;
|
|
278
274
|
} & {
|
|
279
275
|
children?: ReactNode | undefined;
|
|
280
276
|
} & RefAttributes<MessengerSessionRef>>;
|
|
@@ -573,7 +569,6 @@ declare interface AIAgentMessengerSessionContextValue {
|
|
|
573
569
|
userSession: null | UserSession;
|
|
574
570
|
aiAgentInfo: null | AIAgentInfo;
|
|
575
571
|
launcherInfo: null | LauncherInfo;
|
|
576
|
-
presentMethod: PresentMethod;
|
|
577
572
|
|
|
578
573
|
connectionError?: Error;
|
|
579
574
|
|
|
@@ -760,10 +755,6 @@ export declare type AIAgentProps = PropsWithChildren<{
|
|
|
760
755
|
messageTemplate?: {
|
|
761
756
|
__internalVariables?: InternalMessageTemplateVariables;
|
|
762
757
|
};
|
|
763
|
-
/**
|
|
764
|
-
* @internal DO NOT USE THIS - Used for conversation initial render stat tracking.
|
|
765
|
-
*/
|
|
766
|
-
presentMethod?: PresentMethod;
|
|
767
758
|
}>;
|
|
768
759
|
|
|
769
760
|
declare interface AIAgentQueryParams {
|
|
@@ -940,18 +931,21 @@ declare interface CommandPayloads {
|
|
|
940
931
|
[CommandType.ConversationClose]: undefined | CloseConversationCommandParams;
|
|
941
932
|
[CommandType.MessengerSettingsUpdated]: MessengerSettingsUpdatedParams;
|
|
942
933
|
[CommandType.ActiveChannelUpdated]: ActiveChannelUpdatedParams;
|
|
934
|
+
[CommandType.AnonymousSessionTokenExpired]: undefined;
|
|
943
935
|
}
|
|
944
936
|
|
|
945
937
|
export declare const Commands = {
|
|
946
938
|
CloseConversation: (params?: CloseConversationCommandParams) => new CloseConversationCommand(params),
|
|
947
939
|
MessengerSettingsUpdated: (params: MessengerSettingsUpdatedParams) => new MessengerSettingsUpdatedCommand(params),
|
|
948
940
|
ActiveChannelUpdated: (params: ActiveChannelUpdatedParams) => new ActiveChannelUpdatedCommand(params),
|
|
941
|
+
AnonymousSessionTokenExpired: () => new AnonymousSessionTokenExpiredCommand(),
|
|
949
942
|
};
|
|
950
943
|
|
|
951
944
|
declare enum CommandType {
|
|
952
945
|
ConversationClose = 'conv.close',
|
|
953
946
|
MessengerSettingsUpdated = 'messenger.settings.updated',
|
|
954
947
|
ActiveChannelUpdated = 'active.channel.updated',
|
|
948
|
+
AnonymousSessionTokenExpired = 'anon.token.expired',
|
|
955
949
|
}
|
|
956
950
|
|
|
957
951
|
declare interface ContextObject {
|
|
@@ -1063,11 +1057,11 @@ declare interface ConversationHeaderTemplateProps {
|
|
|
1063
1057
|
}
|
|
1064
1058
|
|
|
1065
1059
|
declare class ConversationInitialRenderStats extends AIAgentBaseStats {
|
|
1066
|
-
private presentMethod: PresentMethod;
|
|
1060
|
+
private presentMethod: PresentMethod = 'direct_present';
|
|
1067
1061
|
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
this
|
|
1062
|
+
setPresentMethod(method: PresentMethod): this {
|
|
1063
|
+
this.presentMethod = method;
|
|
1064
|
+
return this;
|
|
1071
1065
|
}
|
|
1072
1066
|
|
|
1073
1067
|
protected getMetricKey(): string {
|
|
@@ -1110,18 +1104,18 @@ declare class ConversationInitialRenderStats extends AIAgentBaseStats {
|
|
|
1110
1104
|
*/
|
|
1111
1105
|
declare class ConversationInitialRenderStatsTracker {
|
|
1112
1106
|
private readonly commitCallback: StatsAppendCallback;
|
|
1113
|
-
private
|
|
1107
|
+
private presentMethod: PresentMethod = 'direct_present';
|
|
1114
1108
|
private stats: ConversationInitialRenderStats | null = null;
|
|
1115
1109
|
|
|
1116
|
-
constructor(commitCallback: StatsAppendCallback
|
|
1110
|
+
constructor(commitCallback: StatsAppendCallback) {
|
|
1117
1111
|
this.commitCallback = commitCallback;
|
|
1118
|
-
this.presentMethod = presentMethod;
|
|
1119
1112
|
}
|
|
1120
1113
|
|
|
1121
1114
|
private getOrCreateStats(): ConversationInitialRenderStats {
|
|
1122
1115
|
if (!this.stats || this.stats.isCommitted()) {
|
|
1123
|
-
this.stats = new ConversationInitialRenderStats(
|
|
1124
|
-
|
|
1116
|
+
this.stats = new ConversationInitialRenderStats()
|
|
1117
|
+
.setCommitCallback(this.commitCallback)
|
|
1118
|
+
.setPresentMethod(this.presentMethod);
|
|
1125
1119
|
}
|
|
1126
1120
|
return this.stats;
|
|
1127
1121
|
}
|
|
@@ -1197,6 +1191,11 @@ declare class ConversationInitialRenderStatsTracker {
|
|
|
1197
1191
|
this.stats?.commit();
|
|
1198
1192
|
}
|
|
1199
1193
|
|
|
1194
|
+
setPresentMethod(method: PresentMethod): void {
|
|
1195
|
+
this.presentMethod = method;
|
|
1196
|
+
this.stats?.setPresentMethod(method);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1200
1199
|
clear(): void {
|
|
1201
1200
|
this.stats = null;
|
|
1202
1201
|
}
|
|
@@ -2987,7 +2986,11 @@ declare class MessengerDispatcher implements Dispatcher {
|
|
|
2987
2986
|
if (callbacks) {
|
|
2988
2987
|
this.logger.debug(`messenger.dispatcher: dispatching command: ${command.type}`, command.payload);
|
|
2989
2988
|
|
|
2990
|
-
|
|
2989
|
+
// Type safety is enforced at subscribe/unsubscribe via generics.
|
|
2990
|
+
// Here, the type is erased because `command.type` is a general CommandType, not a specific literal.
|
|
2991
|
+
const callbackPromises = callbacks.map((callback) =>
|
|
2992
|
+
(callback as (payload: unknown) => void | Promise<void>)(command.payload),
|
|
2993
|
+
);
|
|
2991
2994
|
await Promise.all(callbackPromises).catch((error) => {
|
|
2992
2995
|
this.logger.error(`messenger.dispatcher: error in callback for command: ${command.type}`, error);
|
|
2993
2996
|
});
|
|
@@ -3647,6 +3650,7 @@ declare type SystemMessageUnion =
|
|
|
3647
3650
|
csatExpireAt?: number;
|
|
3648
3651
|
isResolvedWhenDeterminedByUser?: boolean;
|
|
3649
3652
|
onSubmitCSAT: (params: CSATSubmitParams) => Promise<void>;
|
|
3653
|
+
onScrollToBottom?: () => void;
|
|
3650
3654
|
}>;
|
|
3651
3655
|
|
|
3652
3656
|
declare type TextField = {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@sendbird/chat";
|
|
2
|
-
import { a as t, b as n, d as i, C as r, D as C, f as L, g as u, h as v, i as g, j as y, k as x, l as M, n as d, o as m, p as l, q as I, r as c, F as f, I as h, L as p, s as P, M as S, t as A, u as D, O as z, P as B, S as F, v as H, w as O, x as T, y as U, z as b, B as j, E as k } from "./es/
|
|
2
|
+
import { a as t, b as n, d as i, C as r, D as C, f as L, g as u, h as v, i as g, j as y, k as x, l as M, n as d, o as m, p as l, q as I, r as c, F as f, I as h, L as p, s as P, M as S, t as A, u as D, O as z, P as B, S as F, v as H, w as O, x as T, y as U, z as b, B as j, E as k } from "./es/cDVEvKPS.js";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
5
5
|
t as AgentProviderContainer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/ai-agent-messenger-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Delight AI Agent Messenger for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"react-dom": "^19.0.0",
|
|
45
45
|
"strip-json-comments": "^5.0.1",
|
|
46
46
|
"styled-components": "^6.1.15",
|
|
47
|
-
"@sendbird/ai-agent-core": "1.
|
|
48
|
-
"@sendbird/
|
|
49
|
-
"@sendbird/
|
|
47
|
+
"@sendbird/ai-agent-core": "1.19.0",
|
|
48
|
+
"@sendbird/vite-tools": "0.0.1",
|
|
49
|
+
"@sendbird/config-editor": "0.1.0"
|
|
50
50
|
},
|
|
51
51
|
"msw": {
|
|
52
52
|
"workerDirectory": [
|