@aigentyc/chat-sdk 0.5.3 → 0.5.5

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.
Files changed (39) hide show
  1. package/context7.json +1 -1
  2. package/dist/{SlotsContext-B_087V7B.d.ts → SlotsContext-hUp2jze9.d.ts} +8 -0
  3. package/dist/{SlotsContext-DAQiASVu.d.cts → SlotsContext-p_bTEjGT.d.cts} +8 -0
  4. package/dist/ai-elements.cjs +29 -29
  5. package/dist/ai-elements.js +1 -1
  6. package/dist/{chunk-B277MAUK.cjs → chunk-7LJMBYHC.cjs} +5 -11
  7. package/dist/chunk-7LJMBYHC.cjs.map +1 -0
  8. package/dist/{chunk-LVH5ZIYA.cjs → chunk-7MHR4BSJ.cjs} +35 -35
  9. package/dist/{chunk-LVH5ZIYA.cjs.map → chunk-7MHR4BSJ.cjs.map} +1 -1
  10. package/dist/{chunk-MQJ6MGTC.js → chunk-7TMQBROA.js} +5 -5
  11. package/dist/{chunk-MQJ6MGTC.js.map → chunk-7TMQBROA.js.map} +1 -1
  12. package/dist/{chunk-JEK2V5I3.cjs → chunk-AQTN4QLR.cjs} +6 -6
  13. package/dist/{chunk-JEK2V5I3.cjs.map → chunk-AQTN4QLR.cjs.map} +1 -1
  14. package/dist/{chunk-JAEXKKSE.js → chunk-G63CLUHC.js} +21 -2
  15. package/dist/chunk-G63CLUHC.js.map +1 -0
  16. package/dist/{chunk-UXVOUC2A.cjs → chunk-JJRLHXHZ.cjs} +21 -2
  17. package/dist/chunk-JJRLHXHZ.cjs.map +1 -0
  18. package/dist/{chunk-O5TPHZRP.js → chunk-TXX2W7ZR.js} +5 -11
  19. package/dist/chunk-TXX2W7ZR.js.map +1 -0
  20. package/dist/{chunk-CW6LCVNC.js → chunk-ZPOCKCBF.js} +3 -3
  21. package/dist/{chunk-CW6LCVNC.js.map → chunk-ZPOCKCBF.js.map} +1 -1
  22. package/dist/components.cjs +16 -16
  23. package/dist/components.js +5 -5
  24. package/dist/hooks.cjs +4 -4
  25. package/dist/hooks.d.cts +1 -1
  26. package/dist/hooks.d.ts +1 -1
  27. package/dist/hooks.js +1 -1
  28. package/dist/index.cjs +23 -23
  29. package/dist/index.d.cts +1 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.js +6 -6
  32. package/dist/llms-full.txt +2 -2
  33. package/dist/tools.cjs +5 -5
  34. package/dist/tools.js +2 -2
  35. package/package.json +1 -1
  36. package/dist/chunk-B277MAUK.cjs.map +0 -1
  37. package/dist/chunk-JAEXKKSE.js.map +0 -1
  38. package/dist/chunk-O5TPHZRP.js.map +0 -1
  39. package/dist/chunk-UXVOUC2A.cjs.map +0 -1
@@ -3,10 +3,10 @@
3
3
 
4
4
  var chunkDVWX2UGY_cjs = require('./chunk-DVWX2UGY.cjs');
5
5
  var chunkBYX6IOGX_cjs = require('./chunk-BYX6IOGX.cjs');
6
- var chunkB277MAUK_cjs = require('./chunk-B277MAUK.cjs');
6
+ var chunk7LJMBYHC_cjs = require('./chunk-7LJMBYHC.cjs');
7
7
  var chunk72QJ2ORD_cjs = require('./chunk-72QJ2ORD.cjs');
8
- var chunkJEK2V5I3_cjs = require('./chunk-JEK2V5I3.cjs');
9
- var chunkUXVOUC2A_cjs = require('./chunk-UXVOUC2A.cjs');
8
+ var chunkAQTN4QLR_cjs = require('./chunk-AQTN4QLR.cjs');
9
+ var chunkJJRLHXHZ_cjs = require('./chunk-JJRLHXHZ.cjs');
10
10
  var chunk525KS5HM_cjs = require('./chunk-525KS5HM.cjs');
11
11
  var react = require('react');
12
12
  var lucideReact = require('lucide-react');
@@ -31,7 +31,7 @@ var ChatHeader = react.memo(function ChatHeader2({
31
31
  onCartClick
32
32
  }) {
33
33
  const { t, direction } = chunk72QJ2ORD_cjs.useI18n();
34
- const ctx = chunkUXVOUC2A_cjs.useChatContext();
34
+ const ctx = chunkJJRLHXHZ_cjs.useChatContext();
35
35
  const displayName = clientName || ctx.config.clientName || "AI Assistant";
36
36
  const LogoOrIcon = () => {
37
37
  if (logoUrl) {
@@ -970,10 +970,10 @@ function DefaultUserMessage({ text }) {
970
970
  }
971
971
  function ChatInterface(props) {
972
972
  const { showSources = false } = props;
973
- const { messages, status, error, sendMessage, sessionId, config, retryLastTurn, newConversation: ctxNewConversation } = chunkUXVOUC2A_cjs.useChatContext();
973
+ const { messages, status, error, sendMessage, sessionId, config, retryLastTurn, newConversation: ctxNewConversation } = chunkJJRLHXHZ_cjs.useChatContext();
974
974
  const { t, direction } = chunk72QJ2ORD_cjs.useI18n();
975
975
  chunkBYX6IOGX_cjs.useTheme();
976
- const slots = chunkUXVOUC2A_cjs.useSlots();
976
+ const slots = chunkJJRLHXHZ_cjs.useSlots();
977
977
  let liveChat = null;
978
978
  try {
979
979
  liveChat = chunkDVWX2UGY_cjs.useLiveChat();
@@ -1057,8 +1057,8 @@ function ChatInterface(props) {
1057
1057
  );
1058
1058
  if (showWelcome && messages.length === 0) {
1059
1059
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col", dir: direction, style: { backgroundColor: "var(--ac-background)" }, children: [
1060
- !props.hideHeader && chunkUXVOUC2A_cjs.renderSlot("header", headerProps, ChatHeader, slots),
1061
- chunkUXVOUC2A_cjs.renderSlot(
1060
+ !props.hideHeader && chunkJJRLHXHZ_cjs.renderSlot("header", headerProps, ChatHeader, slots),
1061
+ chunkJJRLHXHZ_cjs.renderSlot(
1062
1062
  "welcomePage",
1063
1063
  {
1064
1064
  onSelectCategory: handleSelectCategory,
@@ -1077,18 +1077,18 @@ function ChatInterface(props) {
1077
1077
  slots
1078
1078
  ),
1079
1079
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 px-[15px] md:px-[40px]", style: { backgroundColor: "var(--ac-background)" }, children: [
1080
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto z-40 w-full", children: chunkUXVOUC2A_cjs.renderSlot(
1080
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto z-40 w-full", children: chunkJJRLHXHZ_cjs.renderSlot(
1081
1081
  "input",
1082
1082
  { value: input, onChange: setInput, onSubmit: handleSubmit, isProcessing },
1083
1083
  ChatInput,
1084
1084
  slots
1085
1085
  ) }),
1086
- chunkUXVOUC2A_cjs.renderSlot("footer", { footerText: props.footerText }, ChatFooter, slots)
1086
+ chunkJJRLHXHZ_cjs.renderSlot("footer", { footerText: props.footerText }, ChatFooter, slots)
1087
1087
  ] })
1088
1088
  ] });
1089
1089
  }
1090
1090
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col", dir: direction, style: { backgroundColor: "var(--ac-background)" }, children: [
1091
- !props.hideHeader && chunkUXVOUC2A_cjs.renderSlot("header", headerProps, ChatHeader, slots),
1091
+ !props.hideHeader && chunkJJRLHXHZ_cjs.renderSlot("header", headerProps, ChatHeader, slots),
1092
1092
  storeOrigin && /* @__PURE__ */ jsxRuntime.jsx(
1093
1093
  CartDrawer,
1094
1094
  {
@@ -1099,32 +1099,32 @@ function ChatInterface(props) {
1099
1099
  }
1100
1100
  ),
1101
1101
  /* @__PURE__ */ jsxRuntime.jsxs(
1102
- chunkB277MAUK_cjs.Conversation,
1102
+ chunk7LJMBYHC_cjs.Conversation,
1103
1103
  {
1104
1104
  className: "flex-1",
1105
- targetScrollTop: anchorLatestTurn ? chunkB277MAUK_cjs.anchorToLatestTurn : void 0,
1105
+ targetScrollTop: anchorLatestTurn ? chunk7LJMBYHC_cjs.anchorToLatestTurn : void 0,
1106
1106
  ...anchorLatestTurn ? { initial: "instant", resize: "instant" } : {},
1107
1107
  children: [
1108
- anchorLatestTurn && /* @__PURE__ */ jsxRuntime.jsx(chunkB277MAUK_cjs.FollowLatestTurn, { turnKey: latestUserId }),
1109
- /* @__PURE__ */ jsxRuntime.jsxs(chunkB277MAUK_cjs.ConversationContent, { className: "px-[15px] md:px-[40px] py-6 sm:py-8 w-full space-y-6", children: [
1110
- messages.length === 0 && chunkUXVOUC2A_cjs.renderSlot("emptyState", {}, chunkB277MAUK_cjs.ConversationEmptyState, slots),
1108
+ anchorLatestTurn && /* @__PURE__ */ jsxRuntime.jsx(chunk7LJMBYHC_cjs.FollowLatestTurn, { turnKey: latestUserId }),
1109
+ /* @__PURE__ */ jsxRuntime.jsxs(chunk7LJMBYHC_cjs.ConversationContent, { className: "px-[15px] md:px-[40px] py-6 sm:py-8 w-full space-y-6", children: [
1110
+ messages.length === 0 && chunkJJRLHXHZ_cjs.renderSlot("emptyState", {}, chunk7LJMBYHC_cjs.ConversationEmptyState, slots),
1111
1111
  messages.map((message, messageIndex) => {
1112
1112
  if (hideFirstUserMessage && messageIndex === 0 && message.role === "user") return null;
1113
1113
  if (message.role === "system") {
1114
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: chunkUXVOUC2A_cjs.renderSlot("systemMessage", { message: message.content }, SystemMessage, slots) }, message.id);
1114
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { children: chunkJJRLHXHZ_cjs.renderSlot("systemMessage", { message: message.content }, SystemMessage, slots) }, message.id);
1115
1115
  }
1116
1116
  return /* @__PURE__ */ jsxRuntime.jsxs(
1117
1117
  "div",
1118
1118
  {
1119
1119
  className: `group ${message.role === "assistant" ? "is-assistant" : "is-user"}`,
1120
- ...message.id === latestUserId ? { [chunkB277MAUK_cjs.LATEST_TURN_ATTR]: "" } : {},
1120
+ ...message.id === latestUserId ? { [chunk7LJMBYHC_cjs.LATEST_TURN_ATTR]: "" } : {},
1121
1121
  children: [
1122
1122
  /* @__PURE__ */ jsxRuntime.jsx(
1123
- chunkB277MAUK_cjs.MessageAttachments,
1123
+ chunk7LJMBYHC_cjs.MessageAttachments,
1124
1124
  {
1125
1125
  className: message.role === "user" ? "mb-2" : "mr-auto ml-0 mb-2",
1126
1126
  children: (message.parts || []).filter((p) => p.type === "file" && p.url).map((p, i) => /* @__PURE__ */ jsxRuntime.jsx(
1127
- chunkB277MAUK_cjs.MessageAttachment,
1127
+ chunk7LJMBYHC_cjs.MessageAttachment,
1128
1128
  {
1129
1129
  className: "size-32",
1130
1130
  data: {
@@ -1151,9 +1151,9 @@ function ChatInterface(props) {
1151
1151
  })().map((part, i) => {
1152
1152
  if (part.type === "text") {
1153
1153
  if (message.role === "assistant") {
1154
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: chunkUXVOUC2A_cjs.renderSlot("assistantMessage", { message, partIndex: i, text: part.text || "" }, DefaultAssistantMessage, slots) }, `${message.id}-${i}`);
1154
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { children: chunkJJRLHXHZ_cjs.renderSlot("assistantMessage", { message, partIndex: i, text: part.text || "" }, DefaultAssistantMessage, slots) }, `${message.id}-${i}`);
1155
1155
  }
1156
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: chunkUXVOUC2A_cjs.renderSlot("userMessage", { message, partIndex: i, text: part.text || "" }, DefaultUserMessage, slots) }, `${message.id}-${i}`);
1156
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { children: chunkJJRLHXHZ_cjs.renderSlot("userMessage", { message, partIndex: i, text: part.text || "" }, DefaultUserMessage, slots) }, `${message.id}-${i}`);
1157
1157
  }
1158
1158
  if (part.type.startsWith("tool-")) {
1159
1159
  const toolName = part.type.replace("tool-", "");
@@ -1171,7 +1171,7 @@ function ChatInterface(props) {
1171
1171
  {
1172
1172
  label: `tool "${toolName}"`,
1173
1173
  children: /* @__PURE__ */ jsxRuntime.jsx(
1174
- chunkJEK2V5I3_cjs.ToolRenderer,
1174
+ chunkAQTN4QLR_cjs.ToolRenderer,
1175
1175
  {
1176
1176
  toolName,
1177
1177
  state: part.state ?? "output-available",
@@ -1190,10 +1190,10 @@ function ChatInterface(props) {
1190
1190
  showSources && message.role === "assistant" && (() => {
1191
1191
  const kbSources = extractKbSources(message.parts);
1192
1192
  if (kbSources.length === 0) return null;
1193
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkB277MAUK_cjs.Sources, { children: [
1194
- /* @__PURE__ */ jsxRuntime.jsx(chunkB277MAUK_cjs.SourcesTrigger, { count: kbSources.length }),
1195
- /* @__PURE__ */ jsxRuntime.jsx(chunkB277MAUK_cjs.SourcesContent, { children: kbSources.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
1196
- chunkB277MAUK_cjs.Source,
1193
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk7LJMBYHC_cjs.Sources, { children: [
1194
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7LJMBYHC_cjs.SourcesTrigger, { count: kbSources.length }),
1195
+ /* @__PURE__ */ jsxRuntime.jsx(chunk7LJMBYHC_cjs.SourcesContent, { children: kbSources.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsx(
1196
+ chunk7LJMBYHC_cjs.Source,
1197
1197
  {
1198
1198
  href: s.sourceUrl ?? "#",
1199
1199
  title: s.documentName || s.pageTitle || `Source ${idx + 1}`
@@ -1202,14 +1202,14 @@ function ChatInterface(props) {
1202
1202
  )) })
1203
1203
  ] });
1204
1204
  })(),
1205
- message.role === "assistant" && chunkUXVOUC2A_cjs.renderSlot("feedback", {
1205
+ message.role === "assistant" && chunkJJRLHXHZ_cjs.renderSlot("feedback", {
1206
1206
  messageId: message.id,
1207
1207
  projectId: config.projectId,
1208
1208
  sessionId,
1209
1209
  apiKey: config.apiKey,
1210
1210
  apiEndpoint: config.apiEndpoint,
1211
1211
  textContent: (message.parts || []).filter((p) => p.type === "text").map((p) => p.text || "").join("\n") || (typeof message.content === "string" ? message.content : "")
1212
- }, chunkB277MAUK_cjs.MessageFeedback, slots)
1212
+ }, chunk7LJMBYHC_cjs.MessageFeedback, slots)
1213
1213
  ]
1214
1214
  },
1215
1215
  message.id
@@ -1223,8 +1223,8 @@ function ChatInterface(props) {
1223
1223
  );
1224
1224
  const allToolsComplete = (lastMessage.parts || []).filter((p) => p.type.startsWith("tool-")).every((p) => p.state === "output-available");
1225
1225
  return allToolsComplete && !hasText;
1226
- })() && /* @__PURE__ */ jsxRuntime.jsx(chunkB277MAUK_cjs.Loader, { text: t("thinking") }),
1227
- status === "error" && chunkUXVOUC2A_cjs.renderSlot(
1226
+ })() && /* @__PURE__ */ jsxRuntime.jsx(chunk7LJMBYHC_cjs.Loader, { text: t("thinking") }),
1227
+ status === "error" && chunkJJRLHXHZ_cjs.renderSlot(
1228
1228
  "error",
1229
1229
  {
1230
1230
  error,
@@ -1249,7 +1249,7 @@ function ChatInterface(props) {
1249
1249
  }
1250
1250
  ),
1251
1251
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto z-40 w-full flex items-end gap-2", children: [
1252
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: chunkUXVOUC2A_cjs.renderSlot(
1252
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: chunkJJRLHXHZ_cjs.renderSlot(
1253
1253
  "input",
1254
1254
  { value: input, onChange: setInput, onSubmit: handleSubmit, isProcessing },
1255
1255
  ChatInput,
@@ -1266,7 +1266,7 @@ function ChatInterface(props) {
1266
1266
  }
1267
1267
  )
1268
1268
  ] }),
1269
- chunkUXVOUC2A_cjs.renderSlot("footer", { footerText: props.footerText }, ChatFooter, slots)
1269
+ chunkJJRLHXHZ_cjs.renderSlot("footer", { footerText: props.footerText }, ChatFooter, slots)
1270
1270
  ] }),
1271
1271
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-session-id": sessionId, className: "hidden" })
1272
1272
  ] });
@@ -1949,5 +1949,5 @@ exports.QuickQuestions = QuickQuestions;
1949
1949
  exports.SystemMessage = SystemMessage;
1950
1950
  exports.WelcomePage = WelcomePage;
1951
1951
  exports.panelMaxWidth = panelMaxWidth;
1952
- //# sourceMappingURL=chunk-LVH5ZIYA.cjs.map
1953
- //# sourceMappingURL=chunk-LVH5ZIYA.cjs.map
1952
+ //# sourceMappingURL=chunk-7MHR4BSJ.cjs.map
1953
+ //# sourceMappingURL=chunk-7MHR4BSJ.cjs.map