@aigentyc/chat-sdk 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/context7.json +1 -1
- package/dist/{ChatInterface-0rq8D5-8.d.cts → ChatInterface-DrzYAWnG.d.cts} +1 -1
- package/dist/{ChatInterface--yaDB5yp.d.ts → ChatInterface-qiVhkmx3.d.ts} +1 -1
- package/dist/{SlotsContext-CWTjP0mA.d.ts → SlotsContext-B_087V7B.d.ts} +99 -5
- package/dist/{SlotsContext-u5CFB7MS.d.cts → SlotsContext-DAQiASVu.d.cts} +99 -5
- package/dist/ai-elements.cjs +164 -567
- package/dist/ai-elements.cjs.map +1 -1
- package/dist/ai-elements.d.cts +10 -2
- package/dist/ai-elements.d.ts +10 -2
- package/dist/ai-elements.js +17 -462
- package/dist/ai-elements.js.map +1 -1
- package/dist/{chunk-LSKOJ7SH.js → chunk-3H4CX3MS.js} +8 -5
- package/dist/chunk-3H4CX3MS.js.map +1 -0
- package/dist/{chunk-4WOBNRRB.cjs → chunk-6CVBJ4EI.cjs} +594 -10
- package/dist/chunk-6CVBJ4EI.cjs.map +1 -0
- package/dist/{chunk-3MP2EGEJ.cjs → chunk-72QJ2ORD.cjs} +4 -2
- package/dist/chunk-72QJ2ORD.cjs.map +1 -0
- package/dist/chunk-BYTPAQ7F.js +70 -0
- package/dist/chunk-BYTPAQ7F.js.map +1 -0
- package/dist/{chunk-P3RPAI4F.cjs → chunk-BYX6IOGX.cjs} +4 -4
- package/dist/{chunk-P3RPAI4F.cjs.map → chunk-BYX6IOGX.cjs.map} +1 -1
- package/dist/{chunk-B27JIQ4Z.js → chunk-CNGIOCLR.js} +577 -7
- package/dist/chunk-CNGIOCLR.js.map +1 -0
- package/dist/chunk-CNPYBLLT.js +81 -0
- package/dist/chunk-CNPYBLLT.js.map +1 -0
- package/dist/{chunk-6ZZTTD5E.js → chunk-CW6LCVNC.js} +3 -3
- package/dist/{chunk-6ZZTTD5E.js.map → chunk-CW6LCVNC.js.map} +1 -1
- package/dist/chunk-DDATCJ3O.cjs +75 -0
- package/dist/chunk-DDATCJ3O.cjs.map +1 -0
- package/dist/{chunk-LVWSWTI3.cjs → chunk-DTOOWY2S.cjs} +184 -74
- package/dist/chunk-DTOOWY2S.cjs.map +1 -0
- package/dist/{chunk-NYQSM3EB.cjs → chunk-DVWX2UGY.cjs} +16 -2
- package/dist/chunk-DVWX2UGY.cjs.map +1 -0
- package/dist/{chunk-TZ7EM3EG.cjs → chunk-EMVZ7HWM.cjs} +44 -2
- package/dist/chunk-EMVZ7HWM.cjs.map +1 -0
- package/dist/{chunk-3EN3DMUL.js → chunk-JAEXKKSE.js} +47 -38
- package/dist/chunk-JAEXKKSE.js.map +1 -0
- package/dist/{chunk-JHWSG5IB.js → chunk-JAOD6CNW.js} +38 -3
- package/dist/chunk-JAOD6CNW.js.map +1 -0
- package/dist/{chunk-OEEDYJTV.cjs → chunk-JEK2V5I3.cjs} +6 -6
- package/dist/{chunk-OEEDYJTV.cjs.map → chunk-JEK2V5I3.cjs.map} +1 -1
- package/dist/{chunk-QYCEHFAB.js → chunk-LDQVDUUJ.js} +4 -2
- package/dist/chunk-LDQVDUUJ.js.map +1 -0
- package/dist/{chunk-AWRQSM42.cjs → chunk-NBZDBH4M.cjs} +8 -5
- package/dist/chunk-NBZDBH4M.cjs.map +1 -0
- package/dist/{chunk-5F3O3ZJH.js → chunk-P7UR37HP.js} +17 -4
- package/dist/chunk-P7UR37HP.js.map +1 -0
- package/dist/{chunk-3KSMOHNY.js → chunk-R3TYC66R.js} +46 -81
- package/dist/chunk-R3TYC66R.js.map +1 -0
- package/dist/{chunk-RAQVW2D7.js → chunk-UTEGHMBN.js} +142 -33
- package/dist/chunk-UTEGHMBN.js.map +1 -0
- package/dist/{chunk-46MUOYPR.cjs → chunk-UXVOUC2A.cjs} +47 -38
- package/dist/chunk-UXVOUC2A.cjs.map +1 -0
- package/dist/{chunk-IU7Q7O5G.js → chunk-VQPOUMBC.js} +3 -3
- package/dist/{chunk-IU7Q7O5G.js.map → chunk-VQPOUMBC.js.map} +1 -1
- package/dist/chunk-VYBHYFG3.cjs +87 -0
- package/dist/chunk-VYBHYFG3.cjs.map +1 -0
- package/dist/{chunk-OU5OZKYH.cjs → chunk-Y4B45DW4.cjs} +48 -90
- package/dist/chunk-Y4B45DW4.cjs.map +1 -0
- package/dist/components.cjs +22 -21
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +10 -9
- package/dist/components.js.map +1 -1
- package/dist/core.cjs +21 -82
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -78
- package/dist/core.js.map +1 -1
- package/dist/hooks.cjs +36 -14
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +7 -5
- package/dist/hooks.js.map +1 -1
- package/dist/i18n.cjs +5 -5
- package/dist/i18n.d.cts +2 -2
- package/dist/i18n.d.ts +2 -2
- package/dist/i18n.js +1 -1
- package/dist/index.cjs +61 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +10 -10
- package/dist/styles.css +1 -1
- package/dist/theme.cjs +4 -4
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +2 -2
- package/dist/tools.cjs +6 -5
- package/dist/tools.d.cts +2 -2
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +3 -2
- package/dist/{types-DQCjs81O.d.cts → types-DRa1zFlN.d.cts} +33 -1
- package/dist/{types-DQCjs81O.d.ts → types-DRa1zFlN.d.ts} +33 -1
- package/dist/ui.cjs +52 -52
- package/dist/ui.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-3EN3DMUL.js.map +0 -1
- package/dist/chunk-3KSMOHNY.js.map +0 -1
- package/dist/chunk-3MP2EGEJ.cjs.map +0 -1
- package/dist/chunk-46MUOYPR.cjs.map +0 -1
- package/dist/chunk-4WOBNRRB.cjs.map +0 -1
- package/dist/chunk-5F3O3ZJH.js.map +0 -1
- package/dist/chunk-AWRQSM42.cjs.map +0 -1
- package/dist/chunk-B27JIQ4Z.js.map +0 -1
- package/dist/chunk-JHWSG5IB.js.map +0 -1
- package/dist/chunk-LSKOJ7SH.js.map +0 -1
- package/dist/chunk-LVWSWTI3.cjs.map +0 -1
- package/dist/chunk-NYQSM3EB.cjs.map +0 -1
- package/dist/chunk-OU5OZKYH.cjs.map +0 -1
- package/dist/chunk-QYCEHFAB.js.map +0 -1
- package/dist/chunk-RAQVW2D7.js.map +0 -1
- package/dist/chunk-TZ7EM3EG.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useIsMobile, useLiveChat, usePreviewEmbed } from './chunk-
|
|
3
|
-
import { useTheme } from './chunk-
|
|
4
|
-
import { Conversation, ConversationContent, ConversationEmptyState, Sources, SourcesTrigger, SourcesContent, Source, MessageFeedback, Loader } from './chunk-
|
|
5
|
-
import { useI18n } from './chunk-
|
|
6
|
-
import { ToolRenderer } from './chunk-
|
|
7
|
-
import { useChatContext, useSlots, renderSlot } from './chunk-
|
|
2
|
+
import { useAutoResize, useIsMobile, useLiveChat, usePreviewEmbed } from './chunk-P7UR37HP.js';
|
|
3
|
+
import { useTheme } from './chunk-VQPOUMBC.js';
|
|
4
|
+
import { Conversation, ConversationContent, ConversationEmptyState, MessageAttachments, MessageAttachment, Sources, SourcesTrigger, SourcesContent, Source, MessageFeedback, Loader } from './chunk-CNGIOCLR.js';
|
|
5
|
+
import { useI18n } from './chunk-LDQVDUUJ.js';
|
|
6
|
+
import { ToolRenderer } from './chunk-CW6LCVNC.js';
|
|
7
|
+
import { useChatContext, useSlots, renderSlot } from './chunk-JAEXKKSE.js';
|
|
8
8
|
import { cn } from './chunk-3RW7O444.js';
|
|
9
9
|
import { memo, useState, useRef, useEffect, useCallback, Component, useMemo } from 'react';
|
|
10
10
|
import { X, ArrowLeft, ShoppingCart, Plus, Ticket, FerrisWheel, Flag, Building, Heart, Star, Calendar, MapPin, Hotel, Coffee, Utensils, Settings, Users, FileText, HelpCircle, Search, Zap, MessageSquare, Shield, Minus, Trash2, Headset, Send, ThumbsUp, ThumbsDown, ExternalLink, SparklesIcon } from 'lucide-react';
|
|
@@ -161,23 +161,30 @@ var ChatInput = memo(function ChatInput2({
|
|
|
161
161
|
placeholder
|
|
162
162
|
}) {
|
|
163
163
|
const [isFocused, setIsFocused] = useState(false);
|
|
164
|
+
const [isComposing, setIsComposing] = useState(false);
|
|
164
165
|
const { t, direction } = useI18n();
|
|
166
|
+
const { ref: textareaRef } = useAutoResize(value, {
|
|
167
|
+
minHeight: 24,
|
|
168
|
+
maxHeight: 160
|
|
169
|
+
});
|
|
165
170
|
const handleKeyDown = (e) => {
|
|
166
|
-
if (e.key
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
if (e.key !== "Enter") return;
|
|
172
|
+
if (isComposing || e.nativeEvent.isComposing) return;
|
|
173
|
+
if (e.shiftKey) return;
|
|
174
|
+
e.preventDefault();
|
|
175
|
+
if (!value.trim() || isProcessing) return;
|
|
176
|
+
onSubmit(value);
|
|
170
177
|
};
|
|
171
178
|
const hasValue = value.trim().length > 0;
|
|
172
179
|
return /* @__PURE__ */ jsxs(
|
|
173
180
|
"div",
|
|
174
181
|
{
|
|
175
182
|
className: `
|
|
176
|
-
relative flex items-
|
|
183
|
+
relative flex items-end gap-3
|
|
177
184
|
rounded-2xl
|
|
178
185
|
border-2 transition-all duration-300
|
|
179
186
|
${isFocused ? "shadow-lg" : "shadow-md hover:shadow-lg"}
|
|
180
|
-
ps-4 md:ps-5 pe-1.5 md:pe-2
|
|
187
|
+
ps-4 md:ps-5 pe-1.5 md:pe-2 py-1.5 md:py-2
|
|
181
188
|
`,
|
|
182
189
|
style: {
|
|
183
190
|
backgroundColor: "var(--ac-background)",
|
|
@@ -187,7 +194,7 @@ var ChatInput = memo(function ChatInput2({
|
|
|
187
194
|
/* @__PURE__ */ jsx(
|
|
188
195
|
"div",
|
|
189
196
|
{
|
|
190
|
-
className: "shrink-0 transition-colors duration-300",
|
|
197
|
+
className: "shrink-0 transition-colors duration-300 self-center",
|
|
191
198
|
style: { color: isFocused ? "var(--ac-primary)" : "#a0a0a0" },
|
|
192
199
|
children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
193
200
|
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
@@ -196,18 +203,21 @@ var ChatInput = memo(function ChatInput2({
|
|
|
196
203
|
}
|
|
197
204
|
),
|
|
198
205
|
/* @__PURE__ */ jsx(
|
|
199
|
-
"
|
|
206
|
+
"textarea",
|
|
200
207
|
{
|
|
208
|
+
ref: textareaRef,
|
|
201
209
|
dir: direction,
|
|
202
|
-
|
|
210
|
+
rows: 1,
|
|
203
211
|
value,
|
|
204
212
|
onChange: (e) => onChange(e.target.value),
|
|
205
213
|
onKeyDown: handleKeyDown,
|
|
214
|
+
onCompositionStart: () => setIsComposing(true),
|
|
215
|
+
onCompositionEnd: () => setIsComposing(false),
|
|
206
216
|
onFocus: () => setIsFocused(true),
|
|
207
217
|
onBlur: () => setIsFocused(false),
|
|
208
218
|
disabled: isProcessing,
|
|
209
219
|
placeholder: placeholder || t("typeMessage"),
|
|
210
|
-
className: "\n flex-1 bg-transparent text-start\n outline-none text-base\n
|
|
220
|
+
className: "\n flex-1 bg-transparent text-start\n outline-none text-base resize-none\n py-[14px] md:py-[17px]\n disabled:opacity-50\n ",
|
|
211
221
|
style: { color: "var(--ac-text)" }
|
|
212
222
|
}
|
|
213
223
|
),
|
|
@@ -220,7 +230,7 @@ var ChatInput = memo(function ChatInput2({
|
|
|
220
230
|
className: `
|
|
221
231
|
group relative flex items-center justify-center
|
|
222
232
|
w-10 h-10 md:w-12 md:h-12
|
|
223
|
-
rounded-xl shrink-0
|
|
233
|
+
rounded-xl shrink-0 self-end mb-1
|
|
224
234
|
transition-all duration-300 overflow-hidden
|
|
225
235
|
${hasValue && !isProcessing ? "shadow-md hover:shadow-lg hover:scale-105" : "cursor-not-allowed"}
|
|
226
236
|
disabled:hover:scale-100
|
|
@@ -783,6 +793,71 @@ function SystemMessage({ message, type }) {
|
|
|
783
793
|
const displayMessage = translateMessage(message, type);
|
|
784
794
|
return /* @__PURE__ */ jsx("div", { className: "flex justify-center my-3", children: /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground bg-muted px-4 py-1.5 rounded-full border border-border/50", children: displayMessage }) });
|
|
785
795
|
}
|
|
796
|
+
function serverMessage(error) {
|
|
797
|
+
const raw = error?.message?.trim();
|
|
798
|
+
if (!raw || !raw.startsWith("{")) return null;
|
|
799
|
+
try {
|
|
800
|
+
const parsed = JSON.parse(raw);
|
|
801
|
+
const message = typeof parsed.error === "string" ? parsed.error.trim() : "";
|
|
802
|
+
return message || null;
|
|
803
|
+
} catch {
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
function isTerminal(error) {
|
|
808
|
+
const raw = error?.message ?? "";
|
|
809
|
+
if (/too_many_messages|message_too_long|request_too_large/.test(raw)) {
|
|
810
|
+
return true;
|
|
811
|
+
}
|
|
812
|
+
return /conversation too long|request too large|message too long/i.test(raw);
|
|
813
|
+
}
|
|
814
|
+
function ChatError({ error, onRetry, onNewConversation }) {
|
|
815
|
+
const { t, direction } = useI18n();
|
|
816
|
+
const terminal = isTerminal(error);
|
|
817
|
+
const detail = serverMessage(error);
|
|
818
|
+
return /* @__PURE__ */ jsxs(
|
|
819
|
+
"div",
|
|
820
|
+
{
|
|
821
|
+
role: "alert",
|
|
822
|
+
dir: direction,
|
|
823
|
+
className: "mx-auto w-full max-w-[520px] rounded-xl border px-4 py-3 text-sm",
|
|
824
|
+
style: {
|
|
825
|
+
borderColor: "var(--ac-error-border, rgba(220, 38, 38, 0.25))",
|
|
826
|
+
backgroundColor: "var(--ac-error-background, rgba(220, 38, 38, 0.06))",
|
|
827
|
+
color: "var(--ac-foreground, inherit)"
|
|
828
|
+
},
|
|
829
|
+
children: [
|
|
830
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: terminal ? t("conversationTooLong") : t("somethingWentWrong") }),
|
|
831
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 opacity-80", children: detail ?? (terminal ? t("conversationTooLongDesc") : t("somethingWentWrongDesc")) }),
|
|
832
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [
|
|
833
|
+
onRetry && !terminal && /* @__PURE__ */ jsx(
|
|
834
|
+
"button",
|
|
835
|
+
{
|
|
836
|
+
type: "button",
|
|
837
|
+
onClick: onRetry,
|
|
838
|
+
className: "rounded-lg px-3 py-1.5 text-sm font-medium",
|
|
839
|
+
style: {
|
|
840
|
+
backgroundColor: "var(--ac-primary, #111827)",
|
|
841
|
+
color: "var(--ac-primary-foreground, #ffffff)"
|
|
842
|
+
},
|
|
843
|
+
children: t("tryAgain")
|
|
844
|
+
}
|
|
845
|
+
),
|
|
846
|
+
/* @__PURE__ */ jsx(
|
|
847
|
+
"button",
|
|
848
|
+
{
|
|
849
|
+
type: "button",
|
|
850
|
+
onClick: onNewConversation,
|
|
851
|
+
className: "rounded-lg border px-3 py-1.5 text-sm font-medium",
|
|
852
|
+
style: { borderColor: "var(--ac-border, rgba(0, 0, 0, 0.15))" },
|
|
853
|
+
children: t("startNewConversation")
|
|
854
|
+
}
|
|
855
|
+
)
|
|
856
|
+
] })
|
|
857
|
+
]
|
|
858
|
+
}
|
|
859
|
+
);
|
|
860
|
+
}
|
|
786
861
|
var ChatErrorBoundary = class extends Component {
|
|
787
862
|
state = { error: null };
|
|
788
863
|
static getDerivedStateFromError(error) {
|
|
@@ -882,7 +957,7 @@ function DefaultUserMessage({ text }) {
|
|
|
882
957
|
return /* @__PURE__ */ jsx(
|
|
883
958
|
"div",
|
|
884
959
|
{
|
|
885
|
-
className: "inline-block rounded-2xl px-3 py-2 max-w-[85%]",
|
|
960
|
+
className: "inline-block rounded-2xl px-3 py-2 max-w-[85%] whitespace-pre-wrap break-words",
|
|
886
961
|
style: {
|
|
887
962
|
backgroundColor: "var(--ac-user-bubble-bg, var(--ac-primary))",
|
|
888
963
|
color: "var(--ac-primary-foreground, #fff)"
|
|
@@ -893,7 +968,7 @@ function DefaultUserMessage({ text }) {
|
|
|
893
968
|
}
|
|
894
969
|
function ChatInterface(props) {
|
|
895
970
|
const { showSources = false } = props;
|
|
896
|
-
const { messages, status, sendMessage, sessionId, config, newConversation: ctxNewConversation } = useChatContext();
|
|
971
|
+
const { messages, status, error, sendMessage, sessionId, config, retryLastTurn, newConversation: ctxNewConversation } = useChatContext();
|
|
897
972
|
const { t, direction } = useI18n();
|
|
898
973
|
useTheme();
|
|
899
974
|
const slots = useSlots();
|
|
@@ -915,12 +990,12 @@ function ChatInterface(props) {
|
|
|
915
990
|
if (messages.length === 0 && !showWelcome) setShowWelcome(true);
|
|
916
991
|
}, [messages.length, showWelcome]);
|
|
917
992
|
const handleSubmit = useCallback(
|
|
918
|
-
(text) => {
|
|
919
|
-
if (!text.trim() || isProcessing) return;
|
|
993
|
+
(text, files) => {
|
|
994
|
+
if (!text.trim() && !files?.length || isProcessing) return;
|
|
920
995
|
if (liveChat?.state === "live") return;
|
|
921
996
|
setShowWelcome(false);
|
|
922
997
|
setInput("");
|
|
923
|
-
sendMessage(text);
|
|
998
|
+
sendMessage(text, files);
|
|
924
999
|
},
|
|
925
1000
|
[isProcessing, sendMessage, liveChat]
|
|
926
1001
|
);
|
|
@@ -1023,12 +1098,36 @@ function ChatInterface(props) {
|
|
|
1023
1098
|
{
|
|
1024
1099
|
className: `group ${message.role === "assistant" ? "is-assistant" : "is-user"}`,
|
|
1025
1100
|
children: [
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1101
|
+
/* @__PURE__ */ jsx(
|
|
1102
|
+
MessageAttachments,
|
|
1103
|
+
{
|
|
1104
|
+
className: message.role === "user" ? "mb-2" : "mr-auto ml-0 mb-2",
|
|
1105
|
+
children: (message.parts || []).filter((p) => p.type === "file" && p.url).map((p, i) => /* @__PURE__ */ jsx(
|
|
1106
|
+
MessageAttachment,
|
|
1107
|
+
{
|
|
1108
|
+
className: "size-32",
|
|
1109
|
+
data: {
|
|
1110
|
+
type: "file",
|
|
1111
|
+
url: p.url,
|
|
1112
|
+
mediaType: p.mediaType ?? "",
|
|
1113
|
+
filename: p.filename
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
`${message.id}-file-${i}`
|
|
1117
|
+
))
|
|
1118
|
+
}
|
|
1119
|
+
),
|
|
1120
|
+
(() => {
|
|
1121
|
+
const parts = (message.parts || []).filter(
|
|
1122
|
+
(p) => p.type !== "file" && !(p.type === "text" && !(p.text || "").trim())
|
|
1123
|
+
);
|
|
1124
|
+
return props.messagePartOrder === "stream-order" ? parts : [...parts].sort((a, b) => {
|
|
1125
|
+
const textFirst = props.messagePartOrder !== "tools-first";
|
|
1126
|
+
if (a.type === "text" && b.type !== "text") return textFirst ? -1 : 1;
|
|
1127
|
+
if (a.type !== "text" && b.type === "text") return textFirst ? 1 : -1;
|
|
1128
|
+
return 0;
|
|
1129
|
+
});
|
|
1130
|
+
})().map((part, i) => {
|
|
1032
1131
|
if (part.type === "text") {
|
|
1033
1132
|
if (message.role === "assistant") {
|
|
1034
1133
|
return /* @__PURE__ */ jsx("div", { children: renderSlot("assistantMessage", { message, partIndex: i, text: part.text || "" }, DefaultAssistantMessage, slots) }, `${message.id}-${i}`);
|
|
@@ -1103,7 +1202,17 @@ function ChatInterface(props) {
|
|
|
1103
1202
|
);
|
|
1104
1203
|
const allToolsComplete = (lastMessage.parts || []).filter((p) => p.type.startsWith("tool-")).every((p) => p.state === "output-available");
|
|
1105
1204
|
return allToolsComplete && !hasText;
|
|
1106
|
-
})() && /* @__PURE__ */ jsx(Loader, { text: t("thinking") })
|
|
1205
|
+
})() && /* @__PURE__ */ jsx(Loader, { text: t("thinking") }),
|
|
1206
|
+
status === "error" && renderSlot(
|
|
1207
|
+
"error",
|
|
1208
|
+
{
|
|
1209
|
+
error,
|
|
1210
|
+
onRetry: retryLastTurn,
|
|
1211
|
+
onNewConversation: handleNewConversation
|
|
1212
|
+
},
|
|
1213
|
+
ChatError,
|
|
1214
|
+
slots
|
|
1215
|
+
)
|
|
1107
1216
|
] }) }),
|
|
1108
1217
|
/* @__PURE__ */ jsxs("div", { className: "shrink-0 px-[15px] md:px-[40px] pb-2", style: { backgroundColor: "var(--ac-background)" }, children: [
|
|
1109
1218
|
props.pageQuestions && props.pageQuestions.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -1118,7 +1227,7 @@ function ChatInterface(props) {
|
|
|
1118
1227
|
/* @__PURE__ */ jsxs("div", { className: "mx-auto z-40 w-full flex items-end gap-2", children: [
|
|
1119
1228
|
/* @__PURE__ */ jsx("div", { className: "flex-1", children: renderSlot(
|
|
1120
1229
|
"input",
|
|
1121
|
-
{ value: input, onChange: setInput, onSubmit:
|
|
1230
|
+
{ value: input, onChange: setInput, onSubmit: handleSubmit, isProcessing },
|
|
1122
1231
|
ChatInput,
|
|
1123
1232
|
slots
|
|
1124
1233
|
) }),
|
|
@@ -1771,6 +1880,6 @@ function PreviewEmbedPanel({ isOpen, isRightSide, zIndex }) {
|
|
|
1771
1880
|
);
|
|
1772
1881
|
}
|
|
1773
1882
|
|
|
1774
|
-
export { CartDrawer, ChatErrorBoundary, ChatFooter, ChatHeader, ChatInput, ChatInterface, FloatingButton, LiveChatPanel, MobileLiveChatDrawer, PreviewEmbedPanel, QuickQuestions, SystemMessage, WelcomePage };
|
|
1775
|
-
//# sourceMappingURL=chunk-
|
|
1776
|
-
//# sourceMappingURL=chunk-
|
|
1883
|
+
export { CartDrawer, ChatError, ChatErrorBoundary, ChatFooter, ChatHeader, ChatInput, ChatInterface, FloatingButton, LiveChatPanel, MobileLiveChatDrawer, PreviewEmbedPanel, QuickQuestions, SystemMessage, WelcomePage };
|
|
1884
|
+
//# sourceMappingURL=chunk-UTEGHMBN.js.map
|
|
1885
|
+
//# sourceMappingURL=chunk-UTEGHMBN.js.map
|