@chrryai/chrry 1.2.21 → 1.2.23

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/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue)](https://www.typescriptlang.org/)
7
7
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
8
 
9
- > Extracted from [Vex](https://askvex.com) - A production AI platform with 6,813+ commits in 2025
9
+ > Extracted from [Vex](https://vex.chrry.ai) - A production AI platform with 6,813+ commits in 2025
10
10
 
11
11
  ---
12
12
 
package/dist/index.d.mts CHANGED
@@ -1371,7 +1371,7 @@ declare const isFirefox: boolean;
1371
1371
  declare function getFlag({ code }: {
1372
1372
  code?: string;
1373
1373
  }): string;
1374
- declare const VERSION = "1.2.21";
1374
+ declare const VERSION = "1.2.23";
1375
1375
  type instructionBase = {
1376
1376
  id: string;
1377
1377
  title: string;
package/dist/index.d.ts CHANGED
@@ -1371,7 +1371,7 @@ declare const isFirefox: boolean;
1371
1371
  declare function getFlag({ code }: {
1372
1372
  code?: string;
1373
1373
  }): string;
1374
- declare const VERSION = "1.2.21";
1374
+ declare const VERSION = "1.2.23";
1375
1375
  type instructionBase = {
1376
1376
  id: string;
1377
1377
  title: string;
package/dist/index.js CHANGED
@@ -486,6 +486,10 @@ var init_locales = __esm({
486
486
  // utils/siteConfig.ts
487
487
  function detectSiteMode(hostname) {
488
488
  const host = hostname || (typeof window !== "undefined" ? window.location.hostname : "");
489
+ console.log(
490
+ `\u{1F680} ~ file: siteConfig.ts:268 ~ process.env.NEXT_PUBLIC_SITE_MODE:`,
491
+ process.env.NEXT_PUBLIC_SITE_MODE
492
+ );
489
493
  if (process.env.NEXT_PUBLIC_SITE_MODE === "chrryDev") {
490
494
  return "chrryDev";
491
495
  }
@@ -495,18 +499,6 @@ function detectSiteMode(hostname) {
495
499
  if (process.env.NEXT_PUBLIC_SITE_MODE === "chrryStore") {
496
500
  return "chrryStore";
497
501
  }
498
- if (process.env.NEXT_PUBLIC_SITE_MODE === "chrryVex") {
499
- return "chrryVex";
500
- }
501
- if (host.includes("vex.chrry.ai")) {
502
- return "chrryVex";
503
- }
504
- if (host.includes("chrry.dev")) {
505
- return "chrryDev";
506
- }
507
- if (host.includes("chrryAI.dev")) {
508
- return "chrryAI";
509
- }
510
502
  return "vex";
511
503
  }
512
504
  function getSiteConfig(m) {
@@ -16508,7 +16500,9 @@ var init_i18n = __esm({
16508
16500
  safeLang = LANGUAGES.some((x) => x.code === lang) ? lang : "en";
16509
16501
  try {
16510
16502
  storage.setItem("language", safeLang);
16511
- BrowserInstance?.storage?.local?.set({ language: safeLang });
16503
+ if (BrowserInstance?.storage?.local?.set) {
16504
+ BrowserInstance.storage.local.set({ language: safeLang });
16505
+ }
16512
16506
  } catch (error) {
16513
16507
  console.log("Error saving language to storage:", error);
16514
16508
  }
@@ -16862,7 +16856,6 @@ function AuthProvider({
16862
16856
  } = (0, import_swr.default)(
16863
16857
  fingerprint && deviceId && shouldFetchSession ? ["session", env] : null,
16864
16858
  async () => {
16865
- const appSlug = void 0;
16866
16859
  const result = await getSession({
16867
16860
  deviceId,
16868
16861
  fingerprint,
@@ -16872,7 +16865,7 @@ function AuthProvider({
16872
16865
  API_URL: API_URL2,
16873
16866
  VERSION: VERSION2,
16874
16867
  token: token || fingerprint,
16875
- appSlug,
16868
+ appSlug: app?.slug || baseApp?.slug,
16876
16869
  agentName,
16877
16870
  chrryUrl
16878
16871
  });
@@ -16927,8 +16920,8 @@ function AuthProvider({
16927
16920
  );
16928
16921
  const chrry = allApps?.find((app2) => !app2.store?.parentStoreId);
16929
16922
  const getAlterNativeDomains = (store2) => {
16930
- if (store2?.domain === "https://askvex.com" || store2?.domain === "https://vex.chrry.ai") {
16931
- return ["https://vex.chrry.ai", "https://askvex.com"];
16923
+ if (store2?.domain === "https://vex.chrry.ai" || store2?.domain === "https://vex.chrry.ai") {
16924
+ return ["https://vex.chrry.ai", "https://vex.chrry.ai"];
16932
16925
  }
16933
16926
  return store2.domain ? [store2.domain] : [];
16934
16927
  };
@@ -16938,6 +16931,7 @@ function AuthProvider({
16938
16931
  return getAlterNativeDomains(item.store).includes(chrryUrl) || item.store.domain === chrryUrl;
16939
16932
  });
16940
16933
  const [app, setAppInternal] = (0, import_react12.useState)(baseApp || session2?.app);
16934
+ console.log(`\u{1F680} ~ file: AuthProvider.tsx:790 ~ baseApp:`, baseApp);
16941
16935
  const [apps, setApps] = (0, import_react12.useState)(store?.apps || []);
16942
16936
  (0, import_react12.useEffect)(() => {
16943
16937
  if (app?.store?.apps && app?.store?.apps.length) {
@@ -17334,7 +17328,7 @@ function DataProvider({
17334
17328
  const [instructions, setInstructions] = (0, import_react14.useState)([]);
17335
17329
  const [affiliateStats, setAffiliateStats] = (0, import_react14.useState)(null);
17336
17330
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react14.useState)(false);
17337
- const VERSION3 = "1.2.21";
17331
+ const VERSION3 = "1.2.23";
17338
17332
  const [weather, setWeather] = useLocalStorage("weather", user?.weather || guest?.weather || void 0);
17339
17333
  const {
17340
17334
  API_URL: API_URL2,
@@ -18309,9 +18303,18 @@ var init_utils = __esm({
18309
18303
  window.history.replaceState({}, "", newUrl);
18310
18304
  };
18311
18305
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
18312
- VERSION = "1.2.21";
18306
+ VERSION = "1.2.23";
18313
18307
  getSlugFromPathname = (path) => {
18314
18308
  const siteConfig = getSiteConfig();
18309
+ console.log(
18310
+ `\u{1F680} ~ file: index.ts:348 ~ siteConfig.slug:`,
18311
+ getAppAndStoreSlugs(path, {
18312
+ defaultAppSlug: siteConfig.slug,
18313
+ defaultStoreSlug: siteConfig.storeSlug,
18314
+ excludedRoutes: excludedSlugRoutes,
18315
+ locales
18316
+ })
18317
+ );
18315
18318
  return getAppAndStoreSlugs(path, {
18316
18319
  defaultAppSlug: siteConfig.slug,
18317
18320
  defaultStoreSlug: siteConfig.storeSlug,
@@ -19266,6 +19269,13 @@ function ChatProvider({
19266
19269
  const [isEmpty, setIsEmpty] = (0, import_react22.useState)(true);
19267
19270
  const [thread2, setThread] = (0, import_react22.useState)(void 0);
19268
19271
  const [messages, setMessages] = (0, import_react22.useState)([]);
19272
+ (0, import_react22.useEffect)(() => {
19273
+ if (messages.length > 0) {
19274
+ setIsEmpty(false);
19275
+ } else {
19276
+ setIsEmpty(true);
19277
+ }
19278
+ }, [messages]);
19269
19279
  const { pathname, addParams } = useNavigation();
19270
19280
  const [threadId, setThreadId] = (0, import_react22.useState)(getThreadId(pathname));
19271
19281
  (0, import_react22.useEffect)(() => {
@@ -26713,6 +26723,7 @@ function Chat({
26713
26723
  threadIdRef.current = threadId;
26714
26724
  }, [threadId]);
26715
26725
  const setThreadId = (id) => {
26726
+ setThreadIdContext(id);
26716
26727
  threadIdRef.current = id;
26717
26728
  };
26718
26729
  const { captureException } = useError();
@@ -26789,6 +26800,14 @@ function Chat({
26789
26800
  const shouldUseCompactMode = compactMode || hasBottomOffset;
26790
26801
  const isChatFloating = !empty && (!showChatInput || shouldUseCompactMode);
26791
26802
  (0, import_react50.useEffect)(() => {
26803
+ if (process.env.NODE_ENV !== "production") {
26804
+ console.log(" Chat floating state", {
26805
+ isChatFloating,
26806
+ empty,
26807
+ showChatInput,
26808
+ shouldUseCompactMode
26809
+ });
26810
+ }
26792
26811
  setIsChatFloating(isChatFloating);
26793
26812
  }, [isChatFloating]);
26794
26813
  const fluxAgent = aiAgents?.find((agent) => agent.name === "flux");
@@ -28401,6 +28420,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
28401
28420
  const isImageGenerationEnabled = selectedAgent?.name == "flux";
28402
28421
  const needSearch = needsWebSearch(inputRef.current);
28403
28422
  (0, import_react50.useEffect)(() => {
28423
+ console.log(`\u{1F680} ~ file: Chat.tsx:2697 ~ empty:`, empty);
28404
28424
  if (empty) return;
28405
28425
  const checkBottomOffset = () => {
28406
28426
  const scrollPosition = window.scrollY;
@@ -28408,9 +28428,14 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
28408
28428
  const viewportHeight = window.innerHeight;
28409
28429
  const distanceFromBottom = documentHeight - (scrollPosition + viewportHeight);
28410
28430
  setHasBottomOffset(distanceFromBottom > 100);
28431
+ console.log(
28432
+ `\u{1F680} ~ file: Chat.tsx:2707 ~ distanceFromBottom:`,
28433
+ distanceFromBottom
28434
+ );
28411
28435
  };
28412
28436
  const handleScroll = () => {
28413
28437
  const scrollPosition = window.scrollY;
28438
+ console.log(`\u{1F680} ~ file: Chat.tsx:2711 ~ scrollPosition:`, scrollPosition);
28414
28439
  const documentHeight = document.documentElement.scrollHeight;
28415
28440
  const currentWindowHeight = window.innerHeight;
28416
28441
  const distanceFromBottom = documentHeight - (scrollPosition + currentWindowHeight);