@chrryai/chrry 1.4.88 → 1.4.90

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 CHANGED
@@ -1902,7 +1902,7 @@ var init_utils = __esm({
1902
1902
  };
1903
1903
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
1904
1904
  config = getSiteConfig(getClientHostname());
1905
- VERSION = config.version || "1.4.88";
1905
+ VERSION = config.version || "1.4.90";
1906
1906
  getSlugFromPathname = (path) => {
1907
1907
  return getAppAndStoreSlugs(path, {
1908
1908
  defaultAppSlug: config.slug,
@@ -24068,7 +24068,7 @@ function DataProvider({ children, ...rest }) {
24068
24068
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24069
24069
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24070
24070
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24071
- const VERSION4 = "1.4.88";
24071
+ const VERSION4 = "1.4.90";
24072
24072
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24073
24073
  const {
24074
24074
  API_URL: API_URL2,
@@ -26463,6 +26463,7 @@ function ChatProvider({
26463
26463
  if (id) {
26464
26464
  setThreadId(id);
26465
26465
  setShouldFetchThread(true);
26466
+ } else {
26466
26467
  setIsChatFloating(false);
26467
26468
  }
26468
26469
  }, [pathname]);
@@ -26580,7 +26581,7 @@ function ChatProvider({
26580
26581
  aiAgents.find((a) => app?.defaultModel && a.name === app?.defaultModel) || favouriteAgent
26581
26582
  );
26582
26583
  const setIsWebSearchEnabled = (value) => {
26583
- value ? setSelectedAgent(perplexityAgent) : setSelectedAgent(sushiAgent);
26584
+ value ? setSelectedAgent(perplexityAgent) : void 0;
26584
26585
  setIsWebSearchEnabledInternal(value);
26585
26586
  };
26586
26587
  const setDebateAgent = (agent) => {
@@ -26622,7 +26623,7 @@ function ChatProvider({
26622
26623
  };
26623
26624
  (0, import_react31.useEffect)(() => {
26624
26625
  const a = aiAgents.find(
26625
- (agent) => app?.defaultModel && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
26626
+ (agent) => app?.defaultModel && app.onlyAgent && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
26626
26627
  );
26627
26628
  if (!a) return;
26628
26629
  setSelectedAgent(a);
@@ -36887,7 +36888,7 @@ function Chat({
36887
36888
  setDebateAgent,
36888
36889
  isDebating,
36889
36890
  setIsDebating,
36890
- setIsChatFloating,
36891
+ setIsChatFloating: setIsChatFloatingContext,
36891
36892
  setIsWebSearchEnabled: setWebSearchEnabledInternal,
36892
36893
  isWebSearchEnabled,
36893
36894
  setInput: setInputInternal,
@@ -36908,7 +36909,7 @@ function Chat({
36908
36909
  setIsImageGenerationEnabled,
36909
36910
  setShouldFocus,
36910
36911
  shouldFocus,
36911
- isChatFloating: isChatFloatingInternal
36912
+ isChatFloating: isChatFloatingContext
36912
36913
  } = useChat();
36913
36914
  const {
36914
36915
  router,
@@ -36930,7 +36931,13 @@ function Chat({
36930
36931
  const { captureException } = useError();
36931
36932
  const { device, os, isStandalone: isStandalone2, isExtension: isExtension2, viewPortWidth, isWeb: isWeb2 } = usePlatform();
36932
36933
  const inputRef = (0, import_react57.useRef)(text2 || "");
36933
- const { addHapticFeedback, playNotification, isDrawerOpen, isSmallDevice } = useTheme2();
36934
+ const {
36935
+ addHapticFeedback,
36936
+ playNotification,
36937
+ isDrawerOpen,
36938
+ isSmallDevice,
36939
+ isMobileDevice
36940
+ } = useTheme2();
36934
36941
  const setSelectedAgent = (agent) => {
36935
36942
  setSelectedAgentInternal(agent);
36936
36943
  setShouldFocus(true);
@@ -37010,18 +37017,12 @@ function Chat({
37010
37017
  }, [isNewChat]);
37011
37018
  const [hasBottomOffset, setHasBottomOffset] = (0, import_react57.useState)(false);
37012
37019
  const shouldUseCompactMode = compactMode || hasBottomOffset;
37013
- const isChatFloating = isChatFloatingInternal || shouldUseCompactMode || !empty && !showChatInput;
37020
+ const floatingInitial = (isChatFloatingContext || shouldUseCompactMode) && !empty && !showChatInput;
37021
+ const [isChatFloating, setIsChatFloatingState] = (0, import_react57.useState)(floatingInitial);
37014
37022
  (0, import_react57.useEffect)(() => {
37015
- if (process.env.NODE_ENV !== "production") {
37016
- console.log(" Chat floating state", {
37017
- isChatFloating,
37018
- empty,
37019
- showChatInput,
37020
- shouldUseCompactMode
37021
- });
37022
- }
37023
- setIsChatFloating(isChatFloating);
37024
- }, [isChatFloating]);
37023
+ setIsChatFloatingContext(floatingInitial);
37024
+ setIsChatFloatingState(floatingInitial);
37025
+ }, [floatingInitial]);
37025
37026
  const stripActionFromText = (text3) => {
37026
37027
  const actionMatch = text3.match(/ACTION:\s*(\{(?:[^{}]|\{[^}]*\})*\})\s*$/);
37027
37028
  if (actionMatch) {
@@ -39126,7 +39127,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39126
39127
  t6("Speak")
39127
39128
  )))
39128
39129
  ),
39129
- /* @__PURE__ */ React.createElement(
39130
+ isHydrated && /* @__PURE__ */ React.createElement(
39130
39131
  Div,
39131
39132
  {
39132
39133
  ref: chatContainerRef,
@@ -39371,7 +39372,9 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39371
39372
  used: quotaInfo.daily.used,
39372
39373
  limit: quotaInfo.daily.limit
39373
39374
  })), /* @__PURE__ */ React.createElement(Span, { style: styles4.quotaReset.style }, t6("Resets in {{time}}", {
39374
- time: formatTimeUntilReset(quotaInfo.daily.resetTime)
39375
+ time: formatTimeUntilReset(
39376
+ quotaInfo.daily.resetTime
39377
+ )
39375
39378
  }))), /* @__PURE__ */ React.createElement(Div, { style: styles4.quotaItem.style }, /* @__PURE__ */ React.createElement(icons_exports.HardDrive, { size: 14, color: "var(--shade-6)" }), /* @__PURE__ */ React.createElement(Span, null, t6("Size: {{used}}/{{limit}} MB", {
39376
39379
  used: quotaInfo.dailySize.used,
39377
39380
  limit: quotaInfo.dailySize.limit
@@ -39447,7 +39450,9 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39447
39450
  "data-agent-name": debateAgent.name,
39448
39451
  onClick: () => {
39449
39452
  if (appStatus?.part) {
39450
- import_react_hot_toast9.default.error(t6("Agent locked during app creation"));
39453
+ import_react_hot_toast9.default.error(
39454
+ t6("Agent locked during app creation")
39455
+ );
39451
39456
  return;
39452
39457
  }
39453
39458
  addHapticFeedback();
@@ -39460,7 +39465,13 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39460
39465
  ...isChrry || !!app?.onlyAgent ? styles4.debateAgentButtonDisabled : {}
39461
39466
  }
39462
39467
  },
39463
- /* @__PURE__ */ React.createElement(Span, { style: { position: "relative", left: "-2px" } }, "|"),
39468
+ /* @__PURE__ */ React.createElement(
39469
+ Span,
39470
+ {
39471
+ style: { position: "relative", left: "-2px" }
39472
+ },
39473
+ "|"
39474
+ ),
39464
39475
  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
39465
39476
  ) : /* @__PURE__ */ React.createElement(
39466
39477
  Button,
@@ -39470,7 +39481,9 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39470
39481
  "data-testid": "agent-select-button",
39471
39482
  onClick: () => {
39472
39483
  if (appStatus?.part) {
39473
- import_react_hot_toast9.default.error(t6("Agent locked during app creation"));
39484
+ import_react_hot_toast9.default.error(
39485
+ t6("Agent locked during app creation")
39486
+ );
39474
39487
  return;
39475
39488
  }
39476
39489
  addHapticFeedback();
@@ -39484,7 +39497,16 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39484
39497
  },
39485
39498
  type: "submit"
39486
39499
  },
39487
- /* @__PURE__ */ React.createElement(Span, { style: styles4.agentName.style }, selectedAgent?.displayName),
39500
+ /* @__PURE__ */ React.createElement(
39501
+ Span,
39502
+ {
39503
+ style: {
39504
+ ...styles4.agentName.style,
39505
+ maxWidth: isMobileDevice ? 75 : 150
39506
+ }
39507
+ },
39508
+ selectedAgent?.displayName
39509
+ ),
39488
39510
  !app?.onlyAgent && /* @__PURE__ */ React.createElement(icons_exports.ChevronDown, { color: "var(--accent-6)", size: 20 })
39489
39511
  )
39490
39512
  ),
@@ -39632,7 +39654,13 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39632
39654
  },
39633
39655
  className: "link"
39634
39656
  },
39635
- /* @__PURE__ */ React.createElement(icons_exports.VideoIcon, { size: 22, color: getButtonColor("video") })
39657
+ /* @__PURE__ */ React.createElement(
39658
+ icons_exports.VideoIcon,
39659
+ {
39660
+ size: 22,
39661
+ color: getButtonColor("video")
39662
+ }
39663
+ )
39636
39664
  ), /* @__PURE__ */ React.createElement(
39637
39665
  Button,
39638
39666
  {
@@ -39680,7 +39708,13 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39680
39708
  },
39681
39709
  className: "link"
39682
39710
  },
39683
- /* @__PURE__ */ React.createElement(icons_exports.AudioLines, { size: 22, color: getButtonColor("audio") })
39711
+ /* @__PURE__ */ React.createElement(
39712
+ icons_exports.AudioLines,
39713
+ {
39714
+ size: 22,
39715
+ color: getButtonColor("audio")
39716
+ }
39717
+ )
39684
39718
  ), /* @__PURE__ */ React.createElement(
39685
39719
  Button,
39686
39720
  {
@@ -39704,7 +39738,13 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
39704
39738
  },
39705
39739
  className: "link"
39706
39740
  },
39707
- /* @__PURE__ */ React.createElement(icons_exports.ImageIcon, { size: 22, color: getButtonColor("image") })
39741
+ /* @__PURE__ */ React.createElement(
39742
+ icons_exports.ImageIcon,
39743
+ {
39744
+ size: 22,
39745
+ color: getButtonColor("image")
39746
+ }
39747
+ )
39708
39748
  )) : needsReview ? /* @__PURE__ */ React.createElement(
39709
39749
  Anchor,
39710
39750
  {