@aigentyc/chat-sdk 0.2.5 → 0.3.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/bin/aigentyc.mjs +10 -4
- package/bin/lib/skill.mjs +84 -0
- package/claude-skill/README.md +32 -0
- package/claude-skill/aigentyc-chat-sdk/SKILL.md +339 -0
- package/context7.json +1 -1
- package/dist/ChatInterface-B0zbA3Lm.d.cts +64 -0
- package/dist/ChatInterface-f8ftS56n.d.ts +64 -0
- package/dist/{JsonRenderResult-Ftw4AKwb.d.cts → JsonRenderResult-D6ogds0_.d.cts} +8 -1
- package/dist/{JsonRenderResult-Ftw4AKwb.d.ts → JsonRenderResult-D6ogds0_.d.ts} +8 -1
- package/dist/JsonRenderResult-GCNFMZYP.js +6 -0
- package/dist/{JsonRenderResult-ZFJ6VWMS.js.map → JsonRenderResult-GCNFMZYP.js.map} +1 -1
- package/dist/JsonRenderResult-II3IBENS.cjs +15 -0
- package/dist/{JsonRenderResult-GQOYPLVH.cjs.map → JsonRenderResult-II3IBENS.cjs.map} +1 -1
- package/dist/{SlotsContext-CBtt36al.d.ts → SlotsContext-BjiX1mRx.d.ts} +17 -2
- package/dist/{SlotsContext-CHvISDJT.d.cts → SlotsContext-CEOBjzfh.d.cts} +17 -2
- package/dist/ai-elements.cjs +114 -393
- package/dist/ai-elements.cjs.map +1 -1
- package/dist/ai-elements.d.cts +2 -31
- package/dist/ai-elements.d.ts +2 -31
- package/dist/ai-elements.js +9 -291
- package/dist/ai-elements.js.map +1 -1
- package/dist/{chunk-5QSXB6UL.cjs → chunk-3HGOLNGG.cjs} +13 -4
- package/dist/chunk-3HGOLNGG.cjs.map +1 -0
- package/dist/{chunk-KVEJAPWA.js → chunk-3KSMOHNY.js} +48 -62
- package/dist/chunk-3KSMOHNY.js.map +1 -0
- package/dist/chunk-4WOBNRRB.cjs +540 -0
- package/dist/chunk-4WOBNRRB.cjs.map +1 -0
- package/dist/{chunk-MC6QDYB6.cjs → chunk-5XF7KH6B.cjs} +166 -67
- package/dist/chunk-5XF7KH6B.cjs.map +1 -0
- package/dist/chunk-7AZMWPKX.cjs +35 -0
- package/dist/chunk-7AZMWPKX.cjs.map +1 -0
- package/dist/{chunk-DMGYQ6NN.cjs → chunk-7IFBPXT3.cjs} +95 -8
- package/dist/chunk-7IFBPXT3.cjs.map +1 -0
- package/dist/{chunk-U3FXVLUK.js → chunk-AD6XWKWB.js} +93 -6
- package/dist/chunk-AD6XWKWB.js.map +1 -0
- package/dist/chunk-B27JIQ4Z.js +528 -0
- package/dist/chunk-B27JIQ4Z.js.map +1 -0
- package/dist/{chunk-J2K7EJYP.cjs → chunk-BPV66QNM.cjs} +6 -4
- package/dist/chunk-BPV66QNM.cjs.map +1 -0
- package/dist/{chunk-FYPJSHCL.js → chunk-FPQ3UCCJ.js} +6 -4
- package/dist/chunk-FPQ3UCCJ.js.map +1 -0
- package/dist/{chunk-J2H6MLQF.cjs → chunk-H7C3AGA2.cjs} +17 -6
- package/dist/chunk-H7C3AGA2.cjs.map +1 -0
- package/dist/{chunk-7L4FS6G7.js → chunk-JHWSG5IB.js} +17 -3
- package/dist/chunk-JHWSG5IB.js.map +1 -0
- package/dist/{chunk-4FBVV64J.js → chunk-M4YRNNGB.js} +13 -4
- package/dist/chunk-M4YRNNGB.js.map +1 -0
- package/dist/{chunk-QDFPJJ5Y.cjs → chunk-OU5OZKYH.cjs} +50 -65
- package/dist/chunk-OU5OZKYH.cjs.map +1 -0
- package/dist/{chunk-C24QG43M.cjs → chunk-TZ7EM3EG.cjs} +17 -2
- package/dist/chunk-TZ7EM3EG.cjs.map +1 -0
- package/dist/chunk-XEAAB5ZM.js +32 -0
- package/dist/chunk-XEAAB5ZM.js.map +1 -0
- package/dist/{chunk-FOZXDUSZ.js → chunk-YG2COKFR.js} +151 -54
- package/dist/chunk-YG2COKFR.js.map +1 -0
- package/dist/{chunk-RPDJXB3U.js → chunk-ZXP7IYRC.js} +17 -6
- package/dist/chunk-ZXP7IYRC.js.map +1 -0
- package/dist/components.cjs +31 -52
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +4 -34
- package/dist/components.d.ts +4 -34
- package/dist/components.js +18 -42
- package/dist/components.js.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/hooks.cjs +6 -6
- package/dist/hooks.d.cts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +2 -2
- package/dist/i18n.d.cts +1 -1
- package/dist/i18n.d.ts +1 -1
- package/dist/index.cjs +45 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -6
- package/dist/index.d.ts +51 -6
- package/dist/index.js +17 -10
- package/dist/index.js.map +1 -1
- package/dist/json-render.cjs +4 -4
- package/dist/json-render.d.cts +1 -1
- package/dist/json-render.d.ts +1 -1
- package/dist/json-render.js +1 -1
- package/dist/llms-full.txt +195 -15
- package/dist/message-feedback-BFh3-qym.d.cts +92 -0
- package/dist/message-feedback-cWR0NVok.d.ts +92 -0
- package/dist/normalize-KzCLLqpU.d.cts +42 -0
- package/dist/normalize-KzCLLqpU.d.ts +42 -0
- package/dist/styles.css +1 -1
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/tools.cjs +16 -7
- package/dist/tools.d.cts +4 -3
- package/dist/tools.d.ts +4 -3
- package/dist/tools.js +4 -3
- package/dist/{types-DKJ_-nbG.d.ts → types-DlNwk-bG.d.cts} +33 -3
- package/dist/{types-DKJ_-nbG.d.cts → types-DlNwk-bG.d.ts} +33 -3
- package/dist/ui.cjs +45 -45
- package/dist/ui.js +2 -2
- package/llms.txt +175 -5
- package/package.json +2 -1
- package/dist/JsonRenderResult-GQOYPLVH.cjs +0 -15
- package/dist/JsonRenderResult-ZFJ6VWMS.js +0 -6
- package/dist/chunk-4FBVV64J.js.map +0 -1
- package/dist/chunk-5QSXB6UL.cjs.map +0 -1
- package/dist/chunk-7L4FS6G7.js.map +0 -1
- package/dist/chunk-A7PCSWIK.js +0 -219
- package/dist/chunk-A7PCSWIK.js.map +0 -1
- package/dist/chunk-C24QG43M.cjs.map +0 -1
- package/dist/chunk-DMGYQ6NN.cjs.map +0 -1
- package/dist/chunk-FOZXDUSZ.js.map +0 -1
- package/dist/chunk-FYPJSHCL.js.map +0 -1
- package/dist/chunk-J2H6MLQF.cjs.map +0 -1
- package/dist/chunk-J2K7EJYP.cjs.map +0 -1
- package/dist/chunk-KVEJAPWA.js.map +0 -1
- package/dist/chunk-MC6QDYB6.cjs.map +0 -1
- package/dist/chunk-QDFPJJ5Y.cjs.map +0 -1
- package/dist/chunk-RPDJXB3U.js.map +0 -1
- package/dist/chunk-RTVEBPAJ.cjs +0 -230
- package/dist/chunk-RTVEBPAJ.cjs.map +0 -1
- package/dist/chunk-U3FXVLUK.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useIsMobile, useLiveChat, usePreviewEmbed } from './chunk-5F3O3ZJH.js';
|
|
3
3
|
import { useTheme } from './chunk-IU7Q7O5G.js';
|
|
4
|
-
import { Conversation, ConversationContent, Sources, SourcesTrigger, SourcesContent, Source, Loader } from './chunk-
|
|
4
|
+
import { Conversation, ConversationContent, ConversationEmptyState, Sources, SourcesTrigger, SourcesContent, Source, MessageFeedback, Loader } from './chunk-B27JIQ4Z.js';
|
|
5
5
|
import { useI18n } from './chunk-QYCEHFAB.js';
|
|
6
|
-
import { ToolRenderer } from './chunk-
|
|
7
|
-
import { useChatContext, useSlots, renderSlot } from './chunk-
|
|
6
|
+
import { ToolRenderer } from './chunk-AD6XWKWB.js';
|
|
7
|
+
import { useChatContext, useSlots, renderSlot } from './chunk-FPQ3UCCJ.js';
|
|
8
8
|
import { cn } from './chunk-3RW7O444.js';
|
|
9
|
-
import { memo, useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
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,
|
|
9
|
+
import { memo, useState, useRef, useEffect, useCallback, Component, useMemo } from 'react';
|
|
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';
|
|
11
11
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
function BotIcon({ className }) {
|
|
@@ -759,6 +759,78 @@ function CartDrawer({ storeOrigin, isOpen, onClose, onCartUpdate }) {
|
|
|
759
759
|
] })
|
|
760
760
|
] }) });
|
|
761
761
|
}
|
|
762
|
+
var TRANSLATIONS = {
|
|
763
|
+
operator_joined: "\u05D4\u05E0\u05E6\u05D9\u05D2 \u05D4\u05E6\u05D8\u05E8\u05E3 \u05DC\u05E9\u05D9\u05D7\u05D4",
|
|
764
|
+
chat_ended: "\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05E1\u05EA\u05D9\u05D9\u05DE\u05D4",
|
|
765
|
+
handed_to_ai: "\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D5\u05E2\u05D1\u05E8\u05D4 \u05D7\u05D6\u05E8\u05D4 \u05DC\u05E2\u05D5\u05D6\u05E8 AI",
|
|
766
|
+
operator_disconnected: "\u05D4\u05E0\u05E6\u05D9\u05D2 \u05D4\u05EA\u05E0\u05EA\u05E7. \u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D7\u05D9\u05D1\u05D5\u05E8 \u05DE\u05D7\u05D3\u05E9...",
|
|
767
|
+
operator_offline: "\u05D4\u05E0\u05E6\u05D9\u05D2 \u05DC\u05D0 \u05D6\u05DE\u05D9\u05DF \u05DB\u05E8\u05D2\u05E2",
|
|
768
|
+
operator_online: "\u05D4\u05E0\u05E6\u05D9\u05D2 \u05D7\u05D6\u05E8 \u05DC\u05E9\u05D9\u05D7\u05D4",
|
|
769
|
+
reassigned: "\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D5\u05E2\u05D1\u05E8\u05D4 \u05DC\u05E0\u05E6\u05D9\u05D2 \u05D0\u05D7\u05E8",
|
|
770
|
+
idle_warning: "\u05D4\u05E0\u05E6\u05D9\u05D2 \u05DC\u05D0 \u05E4\u05E2\u05D9\u05DC \u05DB\u05E8\u05D2\u05E2"
|
|
771
|
+
};
|
|
772
|
+
function translateMessage(message, type) {
|
|
773
|
+
if (type && TRANSLATIONS[type]) {
|
|
774
|
+
const nameMatch = message.match(/^([A-Za-z\u0590-\u05FF\s]+?) (joined|left|ended|disconnected)/);
|
|
775
|
+
if (nameMatch && type === "operator_joined") {
|
|
776
|
+
return `${nameMatch[1]} \u05D4\u05E6\u05D8\u05E8\u05E3/\u05D4 \u05DC\u05E9\u05D9\u05D7\u05D4`;
|
|
777
|
+
}
|
|
778
|
+
return TRANSLATIONS[type];
|
|
779
|
+
}
|
|
780
|
+
return message;
|
|
781
|
+
}
|
|
782
|
+
function SystemMessage({ message, type }) {
|
|
783
|
+
const displayMessage = translateMessage(message, type);
|
|
784
|
+
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
|
+
}
|
|
786
|
+
var ChatErrorBoundary = class extends Component {
|
|
787
|
+
state = { error: null };
|
|
788
|
+
static getDerivedStateFromError(error) {
|
|
789
|
+
return { error };
|
|
790
|
+
}
|
|
791
|
+
componentDidCatch(error, info) {
|
|
792
|
+
this.props.onError?.(error, info);
|
|
793
|
+
if (process.env.NODE_ENV !== "production") {
|
|
794
|
+
console.error(
|
|
795
|
+
`[aigentyc-chat-sdk] ${this.props.label || "component"} threw:`,
|
|
796
|
+
error,
|
|
797
|
+
info
|
|
798
|
+
);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
reset = () => {
|
|
802
|
+
this.setState({ error: null });
|
|
803
|
+
};
|
|
804
|
+
render() {
|
|
805
|
+
if (this.state.error) {
|
|
806
|
+
if (this.props.fallback) {
|
|
807
|
+
return this.props.fallback(this.state.error, this.reset);
|
|
808
|
+
}
|
|
809
|
+
return /* @__PURE__ */ jsxs(
|
|
810
|
+
"div",
|
|
811
|
+
{
|
|
812
|
+
role: "alert",
|
|
813
|
+
className: "my-2 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-xs",
|
|
814
|
+
style: { color: "var(--ac-destructive, #dc2626)" },
|
|
815
|
+
children: [
|
|
816
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium", children: this.props.label ? `Failed to render ${this.props.label}` : "Something went wrong" }),
|
|
817
|
+
process.env.NODE_ENV !== "production" && /* @__PURE__ */ jsx("div", { className: "mt-1 opacity-80 font-mono truncate", children: this.state.error.message }),
|
|
818
|
+
/* @__PURE__ */ jsx(
|
|
819
|
+
"button",
|
|
820
|
+
{
|
|
821
|
+
type: "button",
|
|
822
|
+
onClick: this.reset,
|
|
823
|
+
className: "mt-1 underline text-xs opacity-80 hover:opacity-100",
|
|
824
|
+
children: "Retry"
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
return this.props.children;
|
|
832
|
+
}
|
|
833
|
+
};
|
|
762
834
|
function extractKbSources(parts) {
|
|
763
835
|
if (!Array.isArray(parts)) return [];
|
|
764
836
|
const out = [];
|
|
@@ -789,6 +861,36 @@ function extractKbSources(parts) {
|
|
|
789
861
|
}
|
|
790
862
|
return deduped;
|
|
791
863
|
}
|
|
864
|
+
function DefaultAssistantMessage({ text }) {
|
|
865
|
+
return /* @__PURE__ */ jsxs(
|
|
866
|
+
"div",
|
|
867
|
+
{
|
|
868
|
+
className: "flex gap-[10px] items-start rounded-2xl",
|
|
869
|
+
style: {
|
|
870
|
+
backgroundColor: "var(--ac-assistant-bubble-bg, transparent)",
|
|
871
|
+
padding: "var(--ac-assistant-bubble-padding, 0)",
|
|
872
|
+
color: "var(--ac-assistant-bubble-text, var(--ac-text))"
|
|
873
|
+
},
|
|
874
|
+
children: [
|
|
875
|
+
/* @__PURE__ */ jsx(SparklesIcon, { className: "mt-[2px] w-4 h-4 shrink-0", style: { color: "var(--ac-primary)" } }),
|
|
876
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0 whitespace-pre-wrap", children: text })
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
function DefaultUserMessage({ text }) {
|
|
882
|
+
return /* @__PURE__ */ jsx(
|
|
883
|
+
"div",
|
|
884
|
+
{
|
|
885
|
+
className: "inline-block rounded-2xl px-3 py-2 max-w-[85%]",
|
|
886
|
+
style: {
|
|
887
|
+
backgroundColor: "var(--ac-user-bubble-bg, var(--ac-primary))",
|
|
888
|
+
color: "var(--ac-primary-foreground, #fff)"
|
|
889
|
+
},
|
|
890
|
+
children: text
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
}
|
|
792
894
|
function ChatInterface(props) {
|
|
793
895
|
const { showSources = false } = props;
|
|
794
896
|
const { messages, status, sendMessage, sessionId, config, clearMessages } = useChatContext();
|
|
@@ -810,6 +912,7 @@ function ChatInterface(props) {
|
|
|
810
912
|
const isProcessing = status === "streaming";
|
|
811
913
|
useEffect(() => {
|
|
812
914
|
if (messages.length > 0 && showWelcome) setShowWelcome(false);
|
|
915
|
+
if (messages.length === 0 && !showWelcome) setShowWelcome(true);
|
|
813
916
|
}, [messages.length, showWelcome]);
|
|
814
917
|
const handleSubmit = useCallback(
|
|
815
918
|
(text) => {
|
|
@@ -909,48 +1012,28 @@ function ChatInterface(props) {
|
|
|
909
1012
|
}
|
|
910
1013
|
),
|
|
911
1014
|
/* @__PURE__ */ jsx(Conversation, { className: "flex-1", children: /* @__PURE__ */ jsxs(ConversationContent, { className: "px-[15px] md:px-[40px] py-6 sm:py-8 w-full space-y-6", children: [
|
|
1015
|
+
messages.length === 0 && renderSlot("emptyState", {}, ConversationEmptyState, slots),
|
|
912
1016
|
messages.map((message, messageIndex) => {
|
|
913
1017
|
if (hideFirstUserMessage && messageIndex === 0 && message.role === "user") return null;
|
|
1018
|
+
if (message.role === "system") {
|
|
1019
|
+
return /* @__PURE__ */ jsx("div", { children: renderSlot("systemMessage", { message: message.content }, SystemMessage, slots) }, message.id);
|
|
1020
|
+
}
|
|
914
1021
|
return /* @__PURE__ */ jsxs(
|
|
915
1022
|
"div",
|
|
916
1023
|
{
|
|
917
1024
|
className: `group ${message.role === "assistant" ? "is-assistant" : "is-user"}`,
|
|
918
1025
|
children: [
|
|
919
|
-
[...message.parts || []].sort((a, b) => {
|
|
920
|
-
|
|
921
|
-
if (a.type
|
|
1026
|
+
(props.messagePartOrder === "stream-order" ? message.parts || [] : [...message.parts || []].sort((a, b) => {
|
|
1027
|
+
const textFirst = props.messagePartOrder !== "tools-first";
|
|
1028
|
+
if (a.type === "text" && b.type !== "text") return textFirst ? -1 : 1;
|
|
1029
|
+
if (a.type !== "text" && b.type === "text") return textFirst ? 1 : -1;
|
|
922
1030
|
return 0;
|
|
923
|
-
}).map((part, i) => {
|
|
1031
|
+
})).map((part, i) => {
|
|
924
1032
|
if (part.type === "text") {
|
|
925
1033
|
if (message.role === "assistant") {
|
|
926
|
-
return /* @__PURE__ */ jsx("div", { children:
|
|
927
|
-
"div",
|
|
928
|
-
{
|
|
929
|
-
className: "flex gap-[10px] items-start rounded-2xl",
|
|
930
|
-
style: {
|
|
931
|
-
backgroundColor: "var(--ac-assistant-bubble-bg, transparent)",
|
|
932
|
-
padding: "var(--ac-assistant-bubble-padding, 0)",
|
|
933
|
-
color: "var(--ac-assistant-bubble-text, var(--ac-text))"
|
|
934
|
-
},
|
|
935
|
-
children: [
|
|
936
|
-
/* @__PURE__ */ jsx(SparklesIcon, { className: "mt-[2px] w-4 h-4 shrink-0", style: { color: "var(--ac-primary)" } }),
|
|
937
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0 whitespace-pre-wrap", children: part.text })
|
|
938
|
-
]
|
|
939
|
-
}
|
|
940
|
-
) }, `${message.id}-${i}`);
|
|
1034
|
+
return /* @__PURE__ */ jsx("div", { children: renderSlot("assistantMessage", { message, partIndex: i, text: part.text || "" }, DefaultAssistantMessage, slots) }, `${message.id}-${i}`);
|
|
941
1035
|
}
|
|
942
|
-
return /* @__PURE__ */ jsx(
|
|
943
|
-
"div",
|
|
944
|
-
{
|
|
945
|
-
className: "inline-block rounded-2xl px-3 py-2 max-w-[85%]",
|
|
946
|
-
style: {
|
|
947
|
-
backgroundColor: "var(--ac-user-bubble-bg, var(--ac-primary))",
|
|
948
|
-
color: "var(--ac-primary-foreground, #fff)"
|
|
949
|
-
},
|
|
950
|
-
children: part.text
|
|
951
|
-
},
|
|
952
|
-
`${message.id}-${i}`
|
|
953
|
-
);
|
|
1036
|
+
return /* @__PURE__ */ jsx("div", { children: renderSlot("userMessage", { message, partIndex: i, text: part.text || "" }, DefaultUserMessage, slots) }, `${message.id}-${i}`);
|
|
954
1037
|
}
|
|
955
1038
|
if (part.type.startsWith("tool-")) {
|
|
956
1039
|
const toolName = part.type.replace("tool-", "");
|
|
@@ -964,14 +1047,20 @@ function ChatInterface(props) {
|
|
|
964
1047
|
}
|
|
965
1048
|
const result = output && typeof output === "object" && !Array.isArray(output) && ("data" in output || "uiRenderMode" in output) ? output : { data: output };
|
|
966
1049
|
return /* @__PURE__ */ jsx(
|
|
967
|
-
|
|
1050
|
+
ChatErrorBoundary,
|
|
968
1051
|
{
|
|
969
|
-
toolName
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1052
|
+
label: `tool "${toolName}"`,
|
|
1053
|
+
children: /* @__PURE__ */ jsx(
|
|
1054
|
+
ToolRenderer,
|
|
1055
|
+
{
|
|
1056
|
+
toolName,
|
|
1057
|
+
state: part.state ?? "output-available",
|
|
1058
|
+
args: part.input ?? {},
|
|
1059
|
+
result,
|
|
1060
|
+
onSendMessage: handleSubmit,
|
|
1061
|
+
isProcessing
|
|
1062
|
+
}
|
|
1063
|
+
)
|
|
975
1064
|
},
|
|
976
1065
|
`${message.id}-tool-${i}`
|
|
977
1066
|
);
|
|
@@ -992,7 +1081,15 @@ function ChatInterface(props) {
|
|
|
992
1081
|
`${message.id}-src-${idx}`
|
|
993
1082
|
)) })
|
|
994
1083
|
] });
|
|
995
|
-
})()
|
|
1084
|
+
})(),
|
|
1085
|
+
message.role === "assistant" && renderSlot("feedback", {
|
|
1086
|
+
messageId: message.id,
|
|
1087
|
+
projectId: config.projectId,
|
|
1088
|
+
sessionId,
|
|
1089
|
+
apiKey: config.apiKey,
|
|
1090
|
+
apiEndpoint: config.apiEndpoint,
|
|
1091
|
+
textContent: (message.parts || []).filter((p) => p.type === "text").map((p) => p.text || "").join("\n") || (typeof message.content === "string" ? message.content : "")
|
|
1092
|
+
}, MessageFeedback, slots)
|
|
996
1093
|
]
|
|
997
1094
|
},
|
|
998
1095
|
message.id
|
|
@@ -1103,7 +1200,7 @@ function FloatingButton({
|
|
|
1103
1200
|
"div",
|
|
1104
1201
|
{
|
|
1105
1202
|
dir: isRtl ? "rtl" : "ltr",
|
|
1106
|
-
className: `relative bg-
|
|
1203
|
+
className: `relative bg-card rounded-sm animate-fadeIn ${isBottom ? "mb-1" : "mt-1"}`,
|
|
1107
1204
|
style: {
|
|
1108
1205
|
animation: "fadeIn 0.3s ease-out",
|
|
1109
1206
|
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.12)",
|
|
@@ -1126,7 +1223,7 @@ function FloatingButton({
|
|
|
1126
1223
|
style: {
|
|
1127
1224
|
width: "14px",
|
|
1128
1225
|
height: "14px",
|
|
1129
|
-
background: "
|
|
1226
|
+
background: "var(--ac-card)",
|
|
1130
1227
|
transform: "translateY(-50%) rotate(45deg)",
|
|
1131
1228
|
boxShadow: "2px -2px 4px rgba(0, 0, 0, 0.06)",
|
|
1132
1229
|
...isRightSide ? { right: "-7px" } : { left: "-7px" }
|
|
@@ -1479,12 +1576,12 @@ function ChatView() {
|
|
|
1479
1576
|
/* @__PURE__ */ jsx(
|
|
1480
1577
|
"div",
|
|
1481
1578
|
{
|
|
1482
|
-
className: `rounded-2xl px-3.5 py-2.5 text-[14px] leading-relaxed ${isOperator ? "bg-
|
|
1579
|
+
className: `rounded-2xl px-3.5 py-2.5 text-[14px] leading-relaxed ${isOperator ? "bg-card border border-border text-foreground rounded-bl-md" : "text-white rounded-br-md"}`,
|
|
1483
1580
|
style: !isOperator ? { backgroundColor: "var(--ac-primary, #2f80ed)" } : void 0,
|
|
1484
1581
|
children: msg.content
|
|
1485
1582
|
}
|
|
1486
1583
|
),
|
|
1487
|
-
/* @__PURE__ */ jsx("p", { className: `text-[10px] text-
|
|
1584
|
+
/* @__PURE__ */ jsx("p", { className: `text-[10px] text-muted-foreground mt-0.5 px-1 ${isOperator ? "" : "text-end"}`, children: timeStr })
|
|
1488
1585
|
] })
|
|
1489
1586
|
]
|
|
1490
1587
|
},
|
|
@@ -1493,7 +1590,7 @@ function ChatView() {
|
|
|
1493
1590
|
}),
|
|
1494
1591
|
/* @__PURE__ */ jsx("div", { ref: messagesEndRef })
|
|
1495
1592
|
] }),
|
|
1496
|
-
/* @__PURE__ */ jsx("div", { className: "shrink-0 border-t bg-
|
|
1593
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0 border-t bg-background p-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1497
1594
|
/* @__PURE__ */ jsx(
|
|
1498
1595
|
"input",
|
|
1499
1596
|
{
|
|
@@ -1558,7 +1655,7 @@ function EndedView() {
|
|
|
1558
1655
|
{
|
|
1559
1656
|
type: "button",
|
|
1560
1657
|
onClick: () => setSelected("positive"),
|
|
1561
|
-
className: `p-3 rounded-full transition-colors ${selected === "positive" ? "bg-green-100 text-green-600" : "hover:bg-
|
|
1658
|
+
className: `p-3 rounded-full transition-colors ${selected === "positive" ? "bg-green-100 text-green-600" : "hover:bg-muted text-muted-foreground"}`,
|
|
1562
1659
|
children: /* @__PURE__ */ jsx(ThumbsUp, { className: "h-6 w-6" })
|
|
1563
1660
|
}
|
|
1564
1661
|
),
|
|
@@ -1567,7 +1664,7 @@ function EndedView() {
|
|
|
1567
1664
|
{
|
|
1568
1665
|
type: "button",
|
|
1569
1666
|
onClick: () => setSelected("negative"),
|
|
1570
|
-
className: `p-3 rounded-full transition-colors ${selected === "negative" ? "bg-red-100 text-red-600" : "hover:bg-
|
|
1667
|
+
className: `p-3 rounded-full transition-colors ${selected === "negative" ? "bg-red-100 text-red-600" : "hover:bg-muted text-muted-foreground"}`,
|
|
1571
1668
|
children: /* @__PURE__ */ jsx(ThumbsDown, { className: "h-6 w-6" })
|
|
1572
1669
|
}
|
|
1573
1670
|
)
|
|
@@ -1674,6 +1771,6 @@ function PreviewEmbedPanel({ isOpen, isRightSide, zIndex }) {
|
|
|
1674
1771
|
);
|
|
1675
1772
|
}
|
|
1676
1773
|
|
|
1677
|
-
export { CartDrawer, ChatFooter, ChatHeader, ChatInput, ChatInterface, FloatingButton, LiveChatPanel, MobileLiveChatDrawer, PreviewEmbedPanel, QuickQuestions, WelcomePage };
|
|
1678
|
-
//# sourceMappingURL=chunk-
|
|
1679
|
-
//# sourceMappingURL=chunk-
|
|
1774
|
+
export { CartDrawer, ChatErrorBoundary, ChatFooter, ChatHeader, ChatInput, ChatInterface, FloatingButton, LiveChatPanel, MobileLiveChatDrawer, PreviewEmbedPanel, QuickQuestions, SystemMessage, WelcomePage };
|
|
1775
|
+
//# sourceMappingURL=chunk-YG2COKFR.js.map
|
|
1776
|
+
//# sourceMappingURL=chunk-YG2COKFR.js.map
|