@chrryai/chrry 1.6.8 → 1.6.10
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +69 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -498,7 +498,7 @@ type app = {
|
|
|
498
498
|
displayMode: "standalone" | "fullscreen" | "minimal-ui" | "browser" | null;
|
|
499
499
|
placeholder: string | null;
|
|
500
500
|
extend: Array<string> | null;
|
|
501
|
-
onlyAgent: boolean
|
|
501
|
+
onlyAgent: boolean;
|
|
502
502
|
capabilities: {
|
|
503
503
|
text: boolean;
|
|
504
504
|
image: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -498,7 +498,7 @@ type app = {
|
|
|
498
498
|
displayMode: "standalone" | "fullscreen" | "minimal-ui" | "browser" | null;
|
|
499
499
|
placeholder: string | null;
|
|
500
500
|
extend: Array<string> | null;
|
|
501
|
-
onlyAgent: boolean
|
|
501
|
+
onlyAgent: boolean;
|
|
502
502
|
capabilities: {
|
|
503
503
|
text: boolean;
|
|
504
504
|
image: boolean;
|
package/dist/index.js
CHANGED
|
@@ -782,7 +782,7 @@ var init_siteConfig = __esm({
|
|
|
782
782
|
isStoreApp: false,
|
|
783
783
|
mode: "focus",
|
|
784
784
|
slug: "focus",
|
|
785
|
-
version: "26.10.
|
|
785
|
+
version: "26.10.55",
|
|
786
786
|
storeSlug: "blossom",
|
|
787
787
|
name: "Focus",
|
|
788
788
|
domain: "focus.chrry.ai",
|
|
@@ -3108,7 +3108,7 @@ var init_utils = __esm({
|
|
|
3108
3108
|
};
|
|
3109
3109
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
|
|
3110
3110
|
config = getSiteConfig(getClientHostname());
|
|
3111
|
-
VERSION = config.version || "1.6.
|
|
3111
|
+
VERSION = config.version || "1.6.10";
|
|
3112
3112
|
getSlugFromPathname = (path) => {
|
|
3113
3113
|
return getAppAndStoreSlugs(path, {
|
|
3114
3114
|
defaultAppSlug: config.slug,
|
|
@@ -23693,7 +23693,6 @@ function AuthProvider({
|
|
|
23693
23693
|
"isGuestTest",
|
|
23694
23694
|
fingerprintParam ? TEST_GUEST_FINGERPRINTS.includes(fingerprintParam) : false
|
|
23695
23695
|
);
|
|
23696
|
-
console.log(`\u{1F680} ~ isGuestTest:`, isGuestTest);
|
|
23697
23696
|
const [isMemberTest, setIsLiveMemberTest] = useLocalStorage2(
|
|
23698
23697
|
"isMemberTest",
|
|
23699
23698
|
fingerprintParam ? TEST_MEMBER_FINGERPRINTS.includes(fingerprintParam) : false
|
|
@@ -24616,7 +24615,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24616
24615
|
const [instructions, setInstructions] = (0, import_react21.useState)([]);
|
|
24617
24616
|
const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
|
|
24618
24617
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
|
|
24619
|
-
const VERSION4 = "1.6.
|
|
24618
|
+
const VERSION4 = "1.6.10";
|
|
24620
24619
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24621
24620
|
const {
|
|
24622
24621
|
API_URL: API_URL2,
|
|
@@ -26911,9 +26910,6 @@ function ChatProvider({
|
|
|
26911
26910
|
user?.lastMessage?.createdOn,
|
|
26912
26911
|
guest?.lastMessage?.createdOn
|
|
26913
26912
|
]);
|
|
26914
|
-
(0, import_react29.useEffect)(() => {
|
|
26915
|
-
debateAgent && !user && guest && setDebateAgent(null);
|
|
26916
|
-
}, [user, guest, debateAgent]);
|
|
26917
26913
|
const [nextPage, setNextPage] = (0, import_react29.useState)(void 0);
|
|
26918
26914
|
const threadData = threadSWR || auth.threadData || void 0;
|
|
26919
26915
|
const lastProcessedThreadDataRef = (0, import_react29.useRef)(null);
|
|
@@ -27149,6 +27145,7 @@ function NavigationProvider({ children }) {
|
|
|
27149
27145
|
const [showAddToHomeScreen, setShowAddToHomeScreenInternal] = (0, import_react30.useState)(
|
|
27150
27146
|
searchParams.get("showInstall") === "true"
|
|
27151
27147
|
);
|
|
27148
|
+
const [isInstructionsModalOpen, setIsInstructionsModalOpen] = (0, import_react30.useState)(false);
|
|
27152
27149
|
const siteApp = getSiteConfig();
|
|
27153
27150
|
const setShowAddToHomeScreen = (value) => {
|
|
27154
27151
|
if (typeof window === "undefined") return;
|
|
@@ -27231,7 +27228,9 @@ function NavigationProvider({ children }) {
|
|
|
27231
27228
|
setIsMemoryConsentManageVisible,
|
|
27232
27229
|
isVisitor,
|
|
27233
27230
|
setIsVisitor,
|
|
27234
|
-
refetchThreads
|
|
27231
|
+
refetchThreads,
|
|
27232
|
+
isInstructionsModalOpen,
|
|
27233
|
+
setIsInstructionsModalOpen
|
|
27235
27234
|
}
|
|
27236
27235
|
},
|
|
27237
27236
|
children
|
|
@@ -35438,7 +35437,9 @@ function App({
|
|
|
35438
35437
|
userBaseApp,
|
|
35439
35438
|
token,
|
|
35440
35439
|
loadingApp,
|
|
35441
|
-
storeApp
|
|
35440
|
+
storeApp,
|
|
35441
|
+
hasStoreApps,
|
|
35442
|
+
setLoadingApp
|
|
35442
35443
|
} = useAuth();
|
|
35443
35444
|
const { FRONTEND_URL: FRONTEND_URL2, API_URL: API_URL2 } = useData();
|
|
35444
35445
|
const { router, getStoreSlug } = useNavigationContext();
|
|
@@ -35474,6 +35475,11 @@ function App({
|
|
|
35474
35475
|
});
|
|
35475
35476
|
};
|
|
35476
35477
|
const [appsState, setApps] = import_react53.default.useState(getApps2());
|
|
35478
|
+
(0, import_react53.useEffect)(() => {
|
|
35479
|
+
if (app && !hasStoreApps(app)) {
|
|
35480
|
+
setLoadingApp(app);
|
|
35481
|
+
}
|
|
35482
|
+
}, [appsState]);
|
|
35477
35483
|
(0, import_react53.useEffect)(() => {
|
|
35478
35484
|
setApps(getApps2());
|
|
35479
35485
|
}, [apps, store?.id, store?.appId, currentStoreId, baseApp, app]);
|
|
@@ -35620,9 +35626,6 @@ function App({
|
|
|
35620
35626
|
const canAddName = appFormWatcher?.canSubmit;
|
|
35621
35627
|
const canAddTitle = isManagingApp;
|
|
35622
35628
|
const { appStyles: styles4, utilities } = useStyles();
|
|
35623
|
-
if (!hasHydrated && (isManagingApp || appFormWatcher?.canSubmit)) {
|
|
35624
|
-
return /* @__PURE__ */ import_react53.default.createElement(Loading, { fullScreen: true });
|
|
35625
|
-
}
|
|
35626
35629
|
return /* @__PURE__ */ import_react53.default.createElement(Div, null, /* @__PURE__ */ import_react53.default.createElement(H1, { style: styles4.title.style }, !isManagingApp && !canEditApp && app ? /* @__PURE__ */ import_react53.default.createElement(Div, { style: styles4.appTitle.style }, /* @__PURE__ */ import_react53.default.createElement(
|
|
35627
35630
|
ImageComponent,
|
|
35628
35631
|
{
|
|
@@ -37380,10 +37383,6 @@ function Chat({
|
|
|
37380
37383
|
}, [isNewChat]);
|
|
37381
37384
|
const [hasBottomOffset, setHasBottomOffset] = (0, import_react55.useState)(false);
|
|
37382
37385
|
const shouldUseCompactMode = compactMode || hasBottomOffset;
|
|
37383
|
-
console.log(
|
|
37384
|
-
`\u{1F680} ~ file: Chat.tsx:398 ~ shouldUseCompactMode:`,
|
|
37385
|
-
shouldUseCompactMode
|
|
37386
|
-
);
|
|
37387
37386
|
const floatingInitial = shouldUseCompactMode ? true : empty ? false : isChatFloatingContext && !showChatInput;
|
|
37388
37387
|
const [isChatFloating] = useSyncedState(floatingInitial, [
|
|
37389
37388
|
empty,
|
|
@@ -37391,9 +37390,6 @@ function Chat({
|
|
|
37391
37390
|
isChatFloatingContext,
|
|
37392
37391
|
showChatInput
|
|
37393
37392
|
]);
|
|
37394
|
-
(0, import_react55.useEffect)(() => {
|
|
37395
|
-
setIsChatFloating(isChatFloating);
|
|
37396
|
-
}, [isChatFloating]);
|
|
37397
37393
|
const stripActionFromText = (text3) => {
|
|
37398
37394
|
const actionMatch = text3.match(/ACTION:\s*(\{(?:[^{}]|\{[^}]*\})*\})\s*$/);
|
|
37399
37395
|
if (actionMatch) {
|
|
@@ -37565,11 +37561,14 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
37565
37561
|
const [message2, setMessageInternal] = (0, import_react55.useState)(null);
|
|
37566
37562
|
const setMessage = (message3) => {
|
|
37567
37563
|
setMessageInternal(message3);
|
|
37568
|
-
|
|
37564
|
+
setClientId(message3?.message?.clientId);
|
|
37569
37565
|
};
|
|
37570
37566
|
const isHydrated = useHasHydrated();
|
|
37571
37567
|
const [isAttaching, setIsAttachingInternal] = (0, import_react55.useState)(false);
|
|
37572
|
-
const
|
|
37568
|
+
const [clientId, setClientId] = (0, import_react55.useState)();
|
|
37569
|
+
(0, import_react55.useEffect)(() => {
|
|
37570
|
+
!clientId && setClientId((0, import_uuid3.v4)());
|
|
37571
|
+
}, [clientId]);
|
|
37573
37572
|
const xmlBufferRef = (0, import_react55.useRef)("");
|
|
37574
37573
|
const filteredLogRef = (0, import_react55.useRef)("");
|
|
37575
37574
|
const filterStreamingMessage = (input2) => {
|
|
@@ -38299,7 +38298,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38299
38298
|
content: userMessageText,
|
|
38300
38299
|
isUser: true,
|
|
38301
38300
|
id: (0, import_uuid3.v4)(),
|
|
38302
|
-
clientId
|
|
38301
|
+
clientId,
|
|
38303
38302
|
createdOn: /* @__PURE__ */ new Date(),
|
|
38304
38303
|
guestId: guest?.id,
|
|
38305
38304
|
userId: user?.id
|
|
@@ -38335,7 +38334,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38335
38334
|
formData.append("actionEnabled", JSON.stringify(isExtension2));
|
|
38336
38335
|
formData.append("instructions", instruction);
|
|
38337
38336
|
formData.append("language", language);
|
|
38338
|
-
|
|
38337
|
+
clientId && formData.append("clientId", clientId);
|
|
38339
38338
|
artifacts.forEach((artifact, index) => {
|
|
38340
38339
|
formData.append(`artifact_${index}`, artifact);
|
|
38341
38340
|
});
|
|
@@ -38354,7 +38353,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38354
38353
|
instructions: instruction,
|
|
38355
38354
|
language,
|
|
38356
38355
|
attachmentType: "file",
|
|
38357
|
-
clientId
|
|
38356
|
+
clientId,
|
|
38358
38357
|
appId: app?.id,
|
|
38359
38358
|
moodId: mood?.id,
|
|
38360
38359
|
taskId
|
|
@@ -38404,7 +38403,11 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38404
38403
|
import_react_hot_toast9.default.error("Failed to send message");
|
|
38405
38404
|
return;
|
|
38406
38405
|
}
|
|
38407
|
-
if (!
|
|
38406
|
+
if (!userMessage?.message?.clientId) {
|
|
38407
|
+
import_react_hot_toast9.default.error("Failed to send message");
|
|
38408
|
+
return;
|
|
38409
|
+
}
|
|
38410
|
+
if (!selectedAgent) {
|
|
38408
38411
|
return;
|
|
38409
38412
|
}
|
|
38410
38413
|
let requestBody;
|
|
@@ -38509,7 +38512,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38509
38512
|
captureException(error);
|
|
38510
38513
|
} finally {
|
|
38511
38514
|
setIsLoading(false);
|
|
38512
|
-
|
|
38515
|
+
setClientId((0, import_uuid3.v4)());
|
|
38513
38516
|
}
|
|
38514
38517
|
};
|
|
38515
38518
|
(0, import_react55.useEffect)(() => {
|
|
@@ -38694,18 +38697,21 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38694
38697
|
const shouldStopRef = (0, import_react55.useRef)(false);
|
|
38695
38698
|
const streamContentRef = (0, import_react55.useRef)("");
|
|
38696
38699
|
const isPlayingSillyPopCluster = (0, import_react55.useRef)(false);
|
|
38697
|
-
const webSocketDeps = (0, import_react55.useMemo)(
|
|
38700
|
+
const webSocketDeps = (0, import_react55.useMemo)(
|
|
38701
|
+
() => [isSpeechActive, app?.id],
|
|
38702
|
+
[isSpeechActive, app?.id]
|
|
38703
|
+
);
|
|
38698
38704
|
useWebSocket({
|
|
38699
38705
|
deps: webSocketDeps,
|
|
38700
38706
|
onMessage: async ({ type, data }) => {
|
|
38701
38707
|
const threadId2 = threadIdRef.current;
|
|
38702
38708
|
if (!token) return;
|
|
38703
|
-
const
|
|
38709
|
+
const clientId2 = data?.clientId;
|
|
38704
38710
|
const chunk2 = data?.chunk;
|
|
38705
|
-
if (type === "stream_update" && chunk2 &&
|
|
38711
|
+
if (type === "stream_update" && chunk2 && clientId2 && data.message && (isOwner_default(data.message.message, {
|
|
38706
38712
|
userId: user?.id,
|
|
38707
38713
|
guestId: guest?.id
|
|
38708
|
-
}) ? data
|
|
38714
|
+
}) ? data?.deviceId === deviceId : true)) {
|
|
38709
38715
|
if (isSpeechActive && os !== "ios") {
|
|
38710
38716
|
return;
|
|
38711
38717
|
}
|
|
@@ -38723,7 +38729,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38723
38729
|
const cleanContent = stripActionText(streamContentRef.current, chunk2);
|
|
38724
38730
|
onStreamingUpdate?.({
|
|
38725
38731
|
content: cleanContent,
|
|
38726
|
-
clientId,
|
|
38732
|
+
clientId: clientId2,
|
|
38727
38733
|
aiAgent: data.message?.aiAgent,
|
|
38728
38734
|
isWebSearchEnabled,
|
|
38729
38735
|
isImageGenerationEnabled
|
|
@@ -38805,7 +38811,9 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
38805
38811
|
debateAgentId: data.message.message.agentId,
|
|
38806
38812
|
language,
|
|
38807
38813
|
pauseDebate: true,
|
|
38808
|
-
isSpeechActive
|
|
38814
|
+
isSpeechActive,
|
|
38815
|
+
deviceId,
|
|
38816
|
+
appId: app?.id
|
|
38809
38817
|
});
|
|
38810
38818
|
try {
|
|
38811
38819
|
const agentResponse = await apiFetch(`${API_URL2}/ai`, {
|
|
@@ -39874,7 +39882,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
39874
39882
|
},
|
|
39875
39883
|
"|"
|
|
39876
39884
|
),
|
|
39877
|
-
debateAgent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(icons_exports.DeepSeek, { color: "var(--accent-6)", size: 24 }) : debateAgent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(icons_exports.OpenAI, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "claude" ? /* @__PURE__ */ React.createElement(icons_exports.Claude, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "gemini" ? /* @__PURE__ */ React.createElement(icons_exports.Gemini, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "flux" ? /* @__PURE__ */ React.createElement(icons_exports.Flux, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "perplexity" ? /* @__PURE__ */ React.createElement(icons_exports.Perplexity, { color: "var(--accent-6)", size: 22 }) : null
|
|
39885
|
+
debateAgent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(icons_exports.DeepSeek, { color: "var(--accent-6)", size: 24 }) : debateAgent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(icons_exports.OpenAI, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "claude" ? /* @__PURE__ */ React.createElement(icons_exports.Claude, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "gemini" ? /* @__PURE__ */ React.createElement(icons_exports.Gemini, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "flux" ? /* @__PURE__ */ React.createElement(icons_exports.Flux, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "perplexity" ? /* @__PURE__ */ React.createElement(icons_exports.Perplexity, { color: "var(--accent-6)", size: 22 }) : debateAgent.name === "sushi" ? /* @__PURE__ */ React.createElement(ImageComponent, { icon: "sushi", size: 22 }) : null
|
|
39878
39886
|
) : /* @__PURE__ */ React.createElement(
|
|
39879
39887
|
Button,
|
|
39880
39888
|
{
|
|
@@ -46745,7 +46753,7 @@ function Message({
|
|
|
46745
46753
|
},
|
|
46746
46754
|
key: message2.message.id
|
|
46747
46755
|
},
|
|
46748
|
-
isMobileDevice && /* @__PURE__ */ React.createElement(Span, { style: styles4.agentIcon.style }, agent && message2.message.debateAgentId ? /* @__PURE__ */ React.createElement(React.Fragment, null, agent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(icons_exports.DeepSeek, { size: 35 }) : agent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(icons_exports.OpenAI, { size: 35 }) : agent.name === "claude" ? /* @__PURE__ */ React.createElement(icons_exports.Claude, { size: 35 }) : agent.name === "gemini" ? /* @__PURE__ */ React.createElement(icons_exports.Gemini, { size: 35 }) : agent.name === "flux" ? /* @__PURE__ */ React.createElement(icons_exports.Flux, { size: 35 }) : agent.name === "perplexity" ? /* @__PURE__ */ React.createElement(icons_exports.Perplexity, { size: 35 }) : null) : /* @__PURE__ */ React.createElement(ImageComponent, { app, showLoading: false, size: 35 }), /* @__PURE__ */ React.createElement(Span, { style: styles4.agentMessageTime.style }, timeAgo2(message2.message.createdOn, language))),
|
|
46756
|
+
isMobileDevice && /* @__PURE__ */ React.createElement(Span, { style: styles4.agentIcon.style }, agent && message2.message.debateAgentId ? /* @__PURE__ */ React.createElement(React.Fragment, null, agent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(icons_exports.DeepSeek, { size: 35 }) : agent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(icons_exports.OpenAI, { size: 35 }) : agent.name === "claude" ? /* @__PURE__ */ React.createElement(icons_exports.Claude, { size: 35 }) : agent.name === "gemini" ? /* @__PURE__ */ React.createElement(icons_exports.Gemini, { size: 35 }) : agent.name === "flux" ? /* @__PURE__ */ React.createElement(icons_exports.Flux, { size: 35 }) : agent.name === "perplexity" ? /* @__PURE__ */ React.createElement(icons_exports.Perplexity, { size: 35 }) : agent.name === "sushi" ? /* @__PURE__ */ React.createElement(ImageComponent, { icon: "sushi", size: 35 }) : null) : /* @__PURE__ */ React.createElement(ImageComponent, { app, showLoading: false, size: 35 }), /* @__PURE__ */ React.createElement(Span, { style: styles4.agentMessageTime.style }, timeAgo2(message2.message.createdOn, language))),
|
|
46749
46757
|
!isMobileDevice && /* @__PURE__ */ React.createElement(
|
|
46750
46758
|
Button,
|
|
46751
46759
|
{
|
|
@@ -46764,7 +46772,7 @@ function Message({
|
|
|
46764
46772
|
...styles4.agentIcon.style
|
|
46765
46773
|
}
|
|
46766
46774
|
},
|
|
46767
|
-
agent && message2.message.debateAgentId ? /* @__PURE__ */ React.createElement(React.Fragment, null, agent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(icons_exports.DeepSeek, { size: 35 }) : agent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(icons_exports.OpenAI, { size: 35 }) : agent.name === "claude" ? /* @__PURE__ */ React.createElement(icons_exports.Claude, { size: 35 }) : agent.name === "gemini" ? /* @__PURE__ */ React.createElement(icons_exports.Gemini, { size: 35 }) : agent.name === "flux" ? /* @__PURE__ */ React.createElement(icons_exports.Flux, { size: 35 }) : agent.name === "perplexity" ? /* @__PURE__ */ React.createElement(icons_exports.Perplexity, { size: 35 }) : null) : /* @__PURE__ */ React.createElement(Span, { style: styles4.appIcon.style }, /* @__PURE__ */ React.createElement(ImageComponent, { app, showLoading: false, size: 35 }), /* @__PURE__ */ React.createElement(Span, null, app?.name || "Vex"))
|
|
46775
|
+
agent && message2.message.debateAgentId ? /* @__PURE__ */ React.createElement(React.Fragment, null, agent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(icons_exports.DeepSeek, { size: 35 }) : agent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(icons_exports.OpenAI, { size: 35 }) : agent.name === "claude" ? /* @__PURE__ */ React.createElement(icons_exports.Claude, { size: 35 }) : agent.name === "gemini" ? /* @__PURE__ */ React.createElement(icons_exports.Gemini, { size: 35 }) : agent.name === "flux" ? /* @__PURE__ */ React.createElement(icons_exports.Flux, { size: 35 }) : agent.name === "perplexity" ? /* @__PURE__ */ React.createElement(icons_exports.Perplexity, { size: 35 }) : agent.name === "sushi" ? /* @__PURE__ */ React.createElement(ImageComponent, { icon: "sushi", size: 35 }) : null) : /* @__PURE__ */ React.createElement(Span, { style: styles4.appIcon.style }, /* @__PURE__ */ React.createElement(ImageComponent, { app, showLoading: false, size: 35 }), /* @__PURE__ */ React.createElement(Span, null, app?.name || "Vex"))
|
|
46768
46776
|
),
|
|
46769
46777
|
message2.message.isStreaming && message2.message.content.trim() === "" ? /* @__PURE__ */ React.createElement(Div, { style: styles4.thinking.style }, /* @__PURE__ */ React.createElement(
|
|
46770
46778
|
ImageComponent,
|
|
@@ -50466,7 +50474,7 @@ var init_Thread = __esm({
|
|
|
50466
50474
|
if (!clientId) return;
|
|
50467
50475
|
setMessages((prev2) => {
|
|
50468
50476
|
return prev2.map(
|
|
50469
|
-
(m) => m.message.id === clientId
|
|
50477
|
+
(m) => m.message.id === clientId ? {
|
|
50470
50478
|
...m,
|
|
50471
50479
|
message: {
|
|
50472
50480
|
...m.message,
|
|
@@ -82027,12 +82035,20 @@ function isQuotaExceeded(error) {
|
|
|
82027
82035
|
return false;
|
|
82028
82036
|
}
|
|
82029
82037
|
function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
82030
|
-
|
|
82038
|
+
let db = null;
|
|
82039
|
+
try {
|
|
82040
|
+
db = new SWRDexieDB();
|
|
82041
|
+
} catch (error) {
|
|
82042
|
+
console.warn(
|
|
82043
|
+
"[SWR Cache] Failed to initialize IndexedDB, using memory-only mode:",
|
|
82044
|
+
error
|
|
82045
|
+
);
|
|
82046
|
+
}
|
|
82031
82047
|
const memCache = /* @__PURE__ */ new Map();
|
|
82032
|
-
let degradedMode =
|
|
82048
|
+
let degradedMode = !db;
|
|
82033
82049
|
let gcTimer = null;
|
|
82034
82050
|
async function runGarbageCollection() {
|
|
82035
|
-
if (degradedMode) return;
|
|
82051
|
+
if (degradedMode || !db) return;
|
|
82036
82052
|
try {
|
|
82037
82053
|
const now2 = Date.now();
|
|
82038
82054
|
const expiredKeys = await db.cache.where("ts").below(now2 - config2.ttl).primaryKeys();
|
|
@@ -82056,10 +82072,12 @@ function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
|
82056
82072
|
}
|
|
82057
82073
|
}
|
|
82058
82074
|
} catch (error) {
|
|
82059
|
-
console.warn("[SWR Cache] GC failed:", error);
|
|
82075
|
+
console.warn("[SWR Cache] GC failed, switching to degraded mode:", error);
|
|
82076
|
+
degradedMode = true;
|
|
82060
82077
|
}
|
|
82061
82078
|
}
|
|
82062
82079
|
async function initialize() {
|
|
82080
|
+
if (!db) return;
|
|
82063
82081
|
try {
|
|
82064
82082
|
const now2 = Date.now();
|
|
82065
82083
|
const items = await db.cache.toArray();
|
|
@@ -82089,7 +82107,10 @@ function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
|
82089
82107
|
gcTimer = setInterval(runGarbageCollection, config2.gcInterval);
|
|
82090
82108
|
setTimeout(runGarbageCollection, 1e3);
|
|
82091
82109
|
} catch (error) {
|
|
82092
|
-
console.warn(
|
|
82110
|
+
console.warn(
|
|
82111
|
+
"[SWR Cache] Failed to initialize from IndexedDB, switching to degraded mode:",
|
|
82112
|
+
error
|
|
82113
|
+
);
|
|
82093
82114
|
degradedMode = true;
|
|
82094
82115
|
}
|
|
82095
82116
|
}
|
|
@@ -82097,7 +82118,7 @@ function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
|
82097
82118
|
const cache = {
|
|
82098
82119
|
get: (key) => {
|
|
82099
82120
|
const value = memCache.get(key);
|
|
82100
|
-
if (value !== void 0 && !degradedMode) {
|
|
82121
|
+
if (value !== void 0 && !degradedMode && db) {
|
|
82101
82122
|
db.cache.update(key, { lastAccess: Date.now() }).catch(() => {
|
|
82102
82123
|
});
|
|
82103
82124
|
}
|
|
@@ -82113,11 +82134,11 @@ function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
|
82113
82134
|
lastAccess: Date.now(),
|
|
82114
82135
|
version: SCHEMA_VERSION
|
|
82115
82136
|
};
|
|
82116
|
-
withRetry(() => db.cache.put(entry), config2, `set(${key})`).catch(
|
|
82137
|
+
db && withRetry(() => db.cache.put(entry), config2, `set(${key})`).catch(
|
|
82117
82138
|
(error) => {
|
|
82118
82139
|
if (isQuotaExceeded(error)) {
|
|
82119
82140
|
runGarbageCollection().then(() => {
|
|
82120
|
-
db.cache.put(entry).catch(() => {
|
|
82141
|
+
db && db.cache.put(entry).catch(() => {
|
|
82121
82142
|
console.warn("[SWR Cache] Switching to degraded mode");
|
|
82122
82143
|
degradedMode = true;
|
|
82123
82144
|
});
|
|
@@ -82129,7 +82150,7 @@ function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
|
82129
82150
|
},
|
|
82130
82151
|
delete: (key) => {
|
|
82131
82152
|
memCache.delete(key);
|
|
82132
|
-
if (!degradedMode) {
|
|
82153
|
+
if (!degradedMode && db) {
|
|
82133
82154
|
db.cache.delete(key).catch((error) => {
|
|
82134
82155
|
console.error("[SWR Cache] Failed to delete from IndexedDB:", error);
|
|
82135
82156
|
});
|
|
@@ -82144,7 +82165,7 @@ function createDexieProvider(config2 = DEFAULT_CONFIG) {
|
|
|
82144
82165
|
},
|
|
82145
82166
|
clear: () => {
|
|
82146
82167
|
memCache.clear();
|
|
82147
|
-
if (!degradedMode) {
|
|
82168
|
+
if (!degradedMode && db) {
|
|
82148
82169
|
db.cache.clear().catch((error) => {
|
|
82149
82170
|
console.error("[SWR Cache] Failed to clear IndexedDB:", error);
|
|
82150
82171
|
});
|
|
@@ -82162,12 +82183,7 @@ function createMemoryProvider() {
|
|
|
82162
82183
|
}
|
|
82163
82184
|
function getCacheProvider(_parentCache) {
|
|
82164
82185
|
if (typeof indexedDB !== "undefined") {
|
|
82165
|
-
|
|
82166
|
-
return createDexieProvider(DEFAULT_CONFIG);
|
|
82167
|
-
} catch (error) {
|
|
82168
|
-
console.warn("[SWR Cache] Dexie failed, using memory:", error);
|
|
82169
|
-
return createMemoryProvider();
|
|
82170
|
-
}
|
|
82186
|
+
return createDexieProvider(DEFAULT_CONFIG);
|
|
82171
82187
|
}
|
|
82172
82188
|
return createMemoryProvider();
|
|
82173
82189
|
}
|
|
@@ -82524,16 +82540,10 @@ function useSyncedState(computedValue, deps) {
|
|
|
82524
82540
|
const [localValue, setLocalValue] = (0, import_react117.useState)(computedValue);
|
|
82525
82541
|
const isFirstRender = (0, import_react117.useRef)(true);
|
|
82526
82542
|
(0, import_react117.useEffect)(() => {
|
|
82527
|
-
if (isFirstRender.current) {
|
|
82528
|
-
isFirstRender.current = false;
|
|
82529
|
-
return;
|
|
82530
|
-
}
|
|
82531
82543
|
setLocalValue(computedValue);
|
|
82532
82544
|
}, [...deps || []]);
|
|
82533
82545
|
(0, import_react117.useEffect)(() => {
|
|
82534
|
-
|
|
82535
|
-
setLocalValue(computedValue);
|
|
82536
|
-
}
|
|
82546
|
+
setLocalValue(computedValue);
|
|
82537
82547
|
}, [...deps || []]);
|
|
82538
82548
|
return [localValue, setLocalValue];
|
|
82539
82549
|
}
|