@akropolys/kiku 1.6.0 → 1.6.2
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.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1355,8 +1355,8 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, referencedI
|
|
|
1355
1355
|
const scrollNext = () => {
|
|
1356
1356
|
railRef.current?.scrollBy({ left: 170, behavior: "smooth" });
|
|
1357
1357
|
};
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1358
|
+
const display = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
1359
|
+
if (display.length === 0) return null;
|
|
1360
1360
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-sources-wrap", children: [
|
|
1361
1361
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-sources", ref: railRef, children: display.map((src, si) => {
|
|
1362
1362
|
const isReferenced = !!(src.id && referencedIds.includes(src.id));
|
|
@@ -1531,6 +1531,9 @@ var getFriendlyError = (err) => {
|
|
|
1531
1531
|
if (lower.includes("token limit")) {
|
|
1532
1532
|
return "You've reached your usage limit. Please update your billing limits in your dashboard to continue.";
|
|
1533
1533
|
}
|
|
1534
|
+
if (lower.includes("failed to fetch") || lower.includes("networkerror") || lower.includes("request failed")) {
|
|
1535
|
+
return "The assistant couldn't respond just now \u2014 please try again in a moment.";
|
|
1536
|
+
}
|
|
1534
1537
|
try {
|
|
1535
1538
|
const parsed = JSON.parse(str);
|
|
1536
1539
|
return parsed.error || parsed.message || str;
|
|
@@ -1988,7 +1991,7 @@ function ChatModal({
|
|
|
1988
1991
|
] });
|
|
1989
1992
|
})(),
|
|
1990
1993
|
isLast && lastIntent === "compare" && sources.length >= 2 && !replayMessages && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ComparisonMatrix, { sources, defaultCurrency }),
|
|
1991
|
-
isLast &&
|
|
1994
|
+
isLast && referencedIds.length > 0 && lastIntent !== "compare" && lastAction?.type !== "request_phone" && lastAction?.type !== "awaiting_payment" && lastAction?.type !== "checkout" && !msg.cartSnapshot && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1992
1995
|
SourcesCarousel,
|
|
1993
1996
|
{
|
|
1994
1997
|
sources,
|
|
@@ -2017,7 +2020,7 @@ function ChatModal({
|
|
|
2017
2020
|
SmartContextPills,
|
|
2018
2021
|
{
|
|
2019
2022
|
intent: lastIntent,
|
|
2020
|
-
sources,
|
|
2023
|
+
sources: sources.filter((s) => s.id && referencedIds.includes(s.id)),
|
|
2021
2024
|
onSend: handleSend,
|
|
2022
2025
|
loading
|
|
2023
2026
|
}
|