@chrryai/chrry 1.7.35 → 1.7.38

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
@@ -3264,7 +3264,7 @@ var init_utils = __esm({
3264
3264
  };
3265
3265
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3266
3266
  config = getSiteConfig(getClientHostname2());
3267
- VERSION = config.version || "1.7.35";
3267
+ VERSION = config.version || "1.7.38";
3268
3268
  getSlugFromPathname = (path) => {
3269
3269
  return getAppAndStoreSlugs(path, {
3270
3270
  defaultAppSlug: config.slug,
@@ -23730,7 +23730,15 @@ function AuthProvider({
23730
23730
  import_react_hot_toast.default.error(error);
23731
23731
  }
23732
23732
  }, [error]);
23733
- const { isExtension: isExtension2, isStandalone: isStandalone2, isFirefox: isFirefox2, device, os, browser: browser2 } = usePlatform();
23733
+ const {
23734
+ isExtension: isExtension2,
23735
+ isStandalone: isStandalone2,
23736
+ isFirefox: isFirefox2,
23737
+ device,
23738
+ os,
23739
+ browser: browser2,
23740
+ isNative: isNative2
23741
+ } = usePlatform();
23734
23742
  const env = isDevelopment ? "development" : "production";
23735
23743
  const setEnv = (env2) => {
23736
23744
  fetchSession();
@@ -23874,8 +23882,9 @@ function AuthProvider({
23874
23882
  isLoading: isSessionLoading,
23875
23883
  error: sessionError
23876
23884
  } = (0, import_swr.default)(
23877
- (isExtension2 ? isStorageReady && isCookieReady : true) && (fingerprint || token) && deviceId && shouldFetchSession && !isRemovingApp ? "session" : null,
23885
+ (isExtension2 ? isStorageReady && isCookieReady : true) && fingerprint && token && deviceId && shouldFetchSession && !isRemovingApp ? "session" : null,
23878
23886
  async () => {
23887
+ console.log(`\u{1F680} ~ fingerprint:`, fingerprint);
23879
23888
  try {
23880
23889
  const result = await getSession({
23881
23890
  deviceId,
@@ -24451,6 +24460,7 @@ function AuthProvider({
24451
24460
  setApp(n);
24452
24461
  setStore(n.store);
24453
24462
  setSlug(getAppSlug2(n) || "");
24463
+ return;
24454
24464
  }
24455
24465
  const u = storeAppsSwr?.store?.apps.find((app2) => app2.id === updatedApp?.id);
24456
24466
  if (u) {
@@ -24462,6 +24472,7 @@ function AuthProvider({
24462
24472
  setApp(u);
24463
24473
  setStore(u.store);
24464
24474
  setSlug(getAppSlug2(u) || "");
24475
+ return;
24465
24476
  }
24466
24477
  if (!matchedApp && thread2?.appId) {
24467
24478
  const threadApp = storeApps.find((app2) => app2.id === thread2.appId);
@@ -24853,7 +24864,7 @@ function DataProvider({ children, ...rest }) {
24853
24864
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24854
24865
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24855
24866
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24856
- const VERSION4 = "1.7.35";
24867
+ const VERSION4 = "1.7.38";
24857
24868
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24858
24869
  const {
24859
24870
  API_URL: API_URL2,
@@ -27063,6 +27074,11 @@ function ChatProvider({
27063
27074
  }
27064
27075
  }, [appStatus?.part]);
27065
27076
  const [shouldFetchThread, setShouldFetchThread] = (0, import_react29.useState)(!auth.threadData);
27077
+ (0, import_react29.useEffect)(() => {
27078
+ if (threadId && auth?.threadData?.thread.id !== threadId && !shouldFetchThread) {
27079
+ setShouldFetchThread(true);
27080
+ }
27081
+ }, [threadId, auth?.threadData?.thread.id, shouldFetchThread]);
27066
27082
  const [until, setUntil] = (0, import_react29.useState)(1);
27067
27083
  const [liked, setLiked] = (0, import_react29.useState)(void 0);
27068
27084
  const [isLoading, setIsLoading] = (0, import_react29.useState)(!!threadId);
@@ -27174,8 +27190,8 @@ function ChatProvider({
27174
27190
  setSelectedAgent(a);
27175
27191
  setDebateAgent(null);
27176
27192
  }, [app, aiAgents]);
27177
- const { isDevelopment: isDevelopment2, isE2E: isE2E3, actions } = useData();
27178
- const hourlyLimit = isDevelopment2 && !isE2E3 ? 5e4 : getHourlyLimit({
27193
+ const { isDevelopment: isDevelopment2, isE2E: isE2E4, actions } = useData();
27194
+ const hourlyLimit = isDevelopment2 && !isE2E4 ? 5e4 : getHourlyLimit({
27179
27195
  member: user,
27180
27196
  guest
27181
27197
  });
@@ -43006,7 +43022,7 @@ function SignIn({
43006
43022
  const { t: t5 } = useAppContext();
43007
43023
  const {
43008
43024
  FRONTEND_URL: FRONTEND_URL2,
43009
- isE2E: isE2E3,
43025
+ isE2E: isE2E4,
43010
43026
  isCI: isCI2,
43011
43027
  API_URL: API_URL2,
43012
43028
  TEST_GUEST_FINGERPRINTS,
@@ -43038,7 +43054,7 @@ function SignIn({
43038
43054
  window.removeEventListener("keydown", handleKeyDown);
43039
43055
  };
43040
43056
  }, [part]);
43041
- const E2E = isE2E3 || fingerprint && (TEST_GUEST_FINGERPRINTS.includes(fingerprint) || TEST_MEMBER_FINGERPRINTS.includes(fingerprint));
43057
+ const E2E = isE2E4 || fingerprint && (TEST_GUEST_FINGERPRINTS.includes(fingerprint) || TEST_MEMBER_FINGERPRINTS.includes(fingerprint));
43042
43058
  const handleSignIn = async (part2) => {
43043
43059
  if (E2E) {
43044
43060
  part2 = "credentials";
@@ -43902,7 +43918,7 @@ function Subscribe({
43902
43918
  const checkoutSuccessUrl = (() => {
43903
43919
  params.set("checkout", "success");
43904
43920
  params.set("purchaseType", part2);
43905
- isE2E2 && fingerprint && params.set("fp", fingerprint);
43921
+ token && params.set("auth_token", token);
43906
43922
  return `${FRONTEND_URL2}/?${params.toString()}&session_id={CHECKOUT_SESSION_ID}`;
43907
43923
  })();
43908
43924
  const checkoutCancelUrl = (() => {
@@ -50869,7 +50885,7 @@ var init_Thread = __esm({
50869
50885
  }
50870
50886
  if (isE2E2)
50871
50887
  console.log("\u{1F916} onStreamingUpdate", {
50872
- content,
50888
+ content: content.replace(/__REASONING__.*?__\/REASONING__/gs, ""),
50873
50889
  clientId,
50874
50890
  aiAgent,
50875
50891
  isWebSearchEnabled: isWebSearchEnabled2,