@chrryai/chrry 1.5.53 → 1.5.55

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 CHANGED
@@ -298,6 +298,7 @@ type message = {
298
298
  userId: string | null;
299
299
  guestId: string | null;
300
300
  content: string;
301
+ reasoning: string | null;
301
302
  originalContent: string | null;
302
303
  createdOn: Date;
303
304
  updatedOn: Date;
package/dist/index.d.ts CHANGED
@@ -298,6 +298,7 @@ type message = {
298
298
  userId: string | null;
299
299
  guestId: string | null;
300
300
  content: string;
301
+ reasoning: string | null;
301
302
  originalContent: string | null;
302
303
  createdOn: Date;
303
304
  updatedOn: Date;
package/dist/index.js CHANGED
@@ -489,7 +489,7 @@ var init_locales = __esm({
489
489
 
490
490
  // utils/siteConfig.ts
491
491
  function detectSiteModeDomain(hostname2, mode) {
492
- const defaultMode = process.env.MODE || import_meta?.env?.VITE_SITE_MODE || mode || "vex";
492
+ const defaultMode = process.env.MODE || import_meta?.env?.VITE_SITE_MODE || mode || "zarathustra";
493
493
  const rawHost = hostname2 || (typeof window !== "undefined" ? window?.location?.hostname : "") || "";
494
494
  let host = rawHost?.trim().toLowerCase();
495
495
  if (host?.includes("://")) {
@@ -773,7 +773,7 @@ var init_siteConfig = __esm({
773
773
  favicon: "focus",
774
774
  mode: "focus",
775
775
  slug: "focus",
776
- version: "26.10.49",
776
+ version: "26.10.51",
777
777
  storeSlug: "blossom",
778
778
  name: "Focus",
779
779
  domain: "focus.chrry.ai",
@@ -2093,7 +2093,7 @@ var init_utils = __esm({
2093
2093
  };
2094
2094
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
2095
2095
  config = getSiteConfig(getClientHostname());
2096
- VERSION = config.version || "1.5.53";
2096
+ VERSION = config.version || "1.5.55";
2097
2097
  getSlugFromPathname = (path) => {
2098
2098
  return getAppAndStoreSlugs(path, {
2099
2099
  defaultAppSlug: config.slug,
@@ -24383,7 +24383,7 @@ function DataProvider({ children, ...rest }) {
24383
24383
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24384
24384
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24385
24385
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24386
- const VERSION4 = "1.5.53";
24386
+ const VERSION4 = "1.5.55";
24387
24387
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24388
24388
  const {
24389
24389
  API_URL: API_URL2,
@@ -26547,7 +26547,7 @@ function ChatProvider({
26547
26547
  const [wasIncognito, setWasIncognito] = (0, import_react31.useState)(isIncognito);
26548
26548
  const [loading, setLoading] = (0, import_react31.useState)(false);
26549
26549
  const setIsNewAppChat = (item) => {
26550
- if (hasStoreApps(item) && item) {
26550
+ if (!loadingApp && hasStoreApps(item) && item) {
26551
26551
  setIsNewChat(true, getAppSlug(item));
26552
26552
  setLoading(false);
26553
26553
  return;
@@ -46001,6 +46001,38 @@ function Message({
46001
46001
  const [disliked, setDisliked] = (0, import_react76.useState)(void 0);
46002
46002
  const [isSpeechActive, setIsSpeechActive] = (0, import_react76.useState)(false);
46003
46003
  const [isSpeechLoading, setIsSpeechLoading] = (0, import_react76.useState)(false);
46004
+ const [isReasoningExpanded, setIsReasoningExpanded] = (0, import_react76.useState)(false);
46005
+ const [isReasoningStreaming, setIsReasoningStreaming] = (0, import_react76.useState)(false);
46006
+ const reasoningScrollRef = (0, import_react76.useRef)(null);
46007
+ const { content: cleanContent, reasoning } = (0, import_react76.useMemo)(() => {
46008
+ const messageContent = message2.message.content;
46009
+ const reasoningMatches = messageContent.match(
46010
+ /__REASONING__(.*?)__\/REASONING__/gs
46011
+ );
46012
+ if (reasoningMatches) {
46013
+ const extractedReasoning = reasoningMatches.map((match11) => match11.replace(/__REASONING__|__\/REASONING__/g, "")).join("");
46014
+ const cleanedContent = messageContent.replace(
46015
+ /__REASONING__.*?__\/REASONING__/gs,
46016
+ ""
46017
+ );
46018
+ const isStreaming = message2.message.isStreaming && messageContent.includes("__REASONING__");
46019
+ setIsReasoningStreaming(!!isStreaming);
46020
+ return { content: cleanedContent, reasoning: extractedReasoning };
46021
+ }
46022
+ return {
46023
+ content: messageContent,
46024
+ reasoning: message2.message.reasoning || null
46025
+ };
46026
+ }, [
46027
+ message2.message.content,
46028
+ message2.message.reasoning,
46029
+ message2.message.isStreaming
46030
+ ]);
46031
+ (0, import_react76.useEffect)(() => {
46032
+ if (isReasoningStreaming && reasoningScrollRef.current) {
46033
+ reasoningScrollRef.current.scrollTop = reasoningScrollRef.current.scrollHeight;
46034
+ }
46035
+ }, [reasoning, isReasoningStreaming]);
46004
46036
  const limitCheck = (0, import_react76.useMemo)(() => {
46005
46037
  return user || guest ? user ? checkSpeechLimits({
46006
46038
  user,
@@ -46689,7 +46721,49 @@ function Message({
46689
46721
  title: t5("Download image")
46690
46722
  },
46691
46723
  /* @__PURE__ */ React.createElement(icons_exports.Download, { size: 16 })
46692
- )))) : null, message2.message.content === "\u{1F439} Done!" ? /* @__PURE__ */ React.createElement(
46724
+ )))) : null, reasoning && /* @__PURE__ */ React.createElement(
46725
+ Div,
46726
+ {
46727
+ style: {
46728
+ marginBottom: "0.3rem",
46729
+ borderLeft: "3px solid var(--accent-1)",
46730
+ paddingLeft: "0.5rem"
46731
+ }
46732
+ },
46733
+ /* @__PURE__ */ React.createElement(
46734
+ Button,
46735
+ {
46736
+ className: "link",
46737
+ onClick: () => setIsReasoningExpanded(!isReasoningExpanded),
46738
+ style: {
46739
+ ...utilities.link.style,
46740
+ display: "flex",
46741
+ alignItems: "center",
46742
+ gap: "0.5rem",
46743
+ fontSize: "0.9rem",
46744
+ color: "var(--accent-1)",
46745
+ marginBottom: "0.5rem"
46746
+ }
46747
+ },
46748
+ t5("Reasoning"),
46749
+ isReasoningExpanded ? "." : "..."
46750
+ ),
46751
+ (isReasoningExpanded || isReasoningStreaming) && /* @__PURE__ */ React.createElement(
46752
+ Div,
46753
+ {
46754
+ ref: reasoningScrollRef,
46755
+ style: {
46756
+ height: !isReasoningStreaming ? "200px" : "100px",
46757
+ overflowY: "auto",
46758
+ fontSize: "0.85rem",
46759
+ color: "var(--shade-6)",
46760
+ whiteSpace: "pre-wrap",
46761
+ background: "var(--background-2)"
46762
+ }
46763
+ },
46764
+ reasoning
46765
+ )
46766
+ ), message2.message.content === "\u{1F439} Done!" ? /* @__PURE__ */ React.createElement(
46693
46767
  Div,
46694
46768
  {
46695
46769
  style: { display: "flex", alignItems: "center", gap: "2rem" }
@@ -46698,7 +46772,7 @@ function Message({
46698
46772
  ) : /* @__PURE__ */ React.createElement(
46699
46773
  MarkdownContent_web_default,
46700
46774
  {
46701
- content: message2.message.content,
46775
+ content: cleanContent,
46702
46776
  webSearchResults: message2.message.webSearchResult || void 0
46703
46777
  }
46704
46778
  )), isSearchStart || message2.message.isStreaming && message2.message.isWebSearchEnabled ? /* @__PURE__ */ React.createElement(Div, { style: styles4.agentWebStreaming.style }, /* @__PURE__ */ React.createElement(Loading, { width: 16, height: 16 }), " ", /* @__PURE__ */ React.createElement(icons_exports.Globe, { color: "var(--accent-1)", size: 16 }), " ", t5("Analyzing...")) : webSearchResult.length > 0 && /* @__PURE__ */ React.createElement(