@chrryai/chrry 1.6.91 → 1.6.92

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
@@ -665,7 +665,8 @@ declare function replaceLinks({ text, pageUrl, }: {
665
665
  pageUrl?: string;
666
666
  }): Array<TextSegment>;
667
667
 
668
- declare const isCI: string | undefined;
668
+ declare const getEnv: () => any;
669
+ declare const isCI: boolean;
669
670
  declare const checkIsExtension: () => boolean;
670
671
  declare const getExtensionUrl: () => any;
671
672
  declare const isProduction: boolean;
@@ -825,21 +826,6 @@ declare function validateFile(file: File, capabilities?: AgentCapabilities, agen
825
826
  */
826
827
  declare function formatFileSize(bytes: number): string;
827
828
 
828
- /**
829
- * Get the appropriate API URL based on execution context
830
- * - Client-side (browser/extension): Use public URL through Cloudflare
831
- * - Server-side (SSR/API): Use internal localhost URL to avoid round-trip
832
- */
833
- declare function getApiUrl(options?: {
834
- forcePublic?: boolean;
835
- }): string;
836
- /**
837
- * Get the full API URL for a specific endpoint
838
- */
839
- declare function getApiEndpoint(path: string, options?: {
840
- forcePublic?: boolean;
841
- }): string;
842
-
843
829
  type BrowserAPIType = typeof chrome | typeof browser;
844
830
 
845
831
  declare const isSameDay: (date1: Date, date2: Date) => boolean;
@@ -857,13 +843,13 @@ declare const ADDITIONAL_CREDITS = 500;
857
843
  declare function isValidUuidV4(uuid: string): boolean;
858
844
  declare function getThreadId(pathname?: string): string | undefined;
859
845
  declare const MAX_TOOL_CALLS_PER_MESSAGE = 7;
860
- declare const WS_URL: string;
861
- declare const WS_SERVER_URL: string;
846
+ declare const WS_URL: any;
847
+ declare const WS_SERVER_URL: any;
862
848
  declare const addParam: (key: string, value: string) => void;
863
849
  declare const FRONTEND_URL: string;
864
850
  declare const PROD_FRONTEND_URL: string;
865
851
  declare const isE2E: boolean;
866
- declare const API_URL: string;
852
+ declare const API_URL: any;
867
853
  declare const apiFetch: (url: string, options?: RequestInit) => Promise<Response>;
868
854
  declare const PROMPT_LIMITS: {
869
855
  INPUT: number;
@@ -1915,4 +1901,4 @@ interface HistoryRouterProviderProps {
1915
1901
  */
1916
1902
  declare function HistoryRouterProvider({ children, }: HistoryRouterProviderProps): React.ReactElement;
1917
1903
 
1918
- export { ADDITIONAL_CREDITS, API_URL, type AgentCapabilities, type AgentModel, type AiAgent, type AiAgentCapabilities, type ApiActions, BrowserInstance, CHRRY_URL, CREDITS_PRICE, type CalendarEventFormData, Chrry, type CreateCustomAiAgent, FREE_DAYS, FRONTEND_URL, type FileValidationResult, GUEST_TASKS_COUNT, HistoryRouterProvider, MAX_FILE_LIMITS, MAX_FILE_SIZES, MAX_TOOL_CALLS_PER_MESSAGE, MEMBER_TASKS_COUNT, OWNER_CREDITS, PDF_LIMITS, PLUS_PRICE, PLUS_TASKS_COUNT, PROD_FRONTEND_URL, PROMPT_LIMITS, PRO_PRICE, Sidebar, Store, VERSION, WS_SERVER_URL, WS_URL, addParam, aiAgentCapabilitiesSchema, aiAgentSchema, apiFetch, type appFormData, appSchema, budgetCategory, capitalizeFirstLetter, checkIsExtension, checkThreadSummaryLimit, createApp, createCalendarEvent, createCustomAiAgentSchema, Chrry as default, deleteApp, deleteCalendarEvent, deleteMemories, deleteMessage, deleteSubscription, exampleInstructions, expenseCategory, type expenseCategoryType, exportToGoogleCalendar, extensionSuggestions, formatFileSize, generateAppMetadata, generateStoreMetadata, generateThreadMetadata, getActions, getApiEndpoint, getApiUrl, getApp, getApps, getBrowserAPI, getBrowserIdentity, getCalendarEvents, getDailyImageLimit, getExampleInstructions, getExtensionUrl, getExtensionUrls, getFlag, getGuest, getHourlyLimit, getImageSrc, getInstructionConfig, getLastMessage, getMaxFileSize, getMetadata, getRedirectURL, getSession, getSlugFromPathname, getThread, getThreadId, getThreads, getTranslations, getUser, getUsers, getWeatherCacheTime, type instructionBase, isCI, isCollaborator, isDeepEqual, isDevelopment, isE2E, isFirefox, isOwner, isProduction, isSameDay, isTestingDevice, isTextFile, isValidUsername, isValidUuidV4, pageSizes, removeParam, removeUser, reorderApps, replaceLinks, storage, syncGoogleCalendar, updateApp, updateCalendarEvent, updateCollaboration, updateGuest, updateMessage, updateThread, updateUser, uploadUserImage, useAppMetadata, useComputedValue, useCookieOrLocalStorage, useCountdown, useDeviceInfo, useHasHydrated, useLocalStorage, usePWAInstall, useStoreMetadata, useSyncedState, useThreadMetadata, utcToday, validateFile };
1904
+ export { ADDITIONAL_CREDITS, API_URL, type AgentCapabilities, type AgentModel, type AiAgent, type AiAgentCapabilities, type ApiActions, BrowserInstance, CHRRY_URL, CREDITS_PRICE, type CalendarEventFormData, Chrry, type CreateCustomAiAgent, FREE_DAYS, FRONTEND_URL, type FileValidationResult, GUEST_TASKS_COUNT, HistoryRouterProvider, MAX_FILE_LIMITS, MAX_FILE_SIZES, MAX_TOOL_CALLS_PER_MESSAGE, MEMBER_TASKS_COUNT, OWNER_CREDITS, PDF_LIMITS, PLUS_PRICE, PLUS_TASKS_COUNT, PROD_FRONTEND_URL, PROMPT_LIMITS, PRO_PRICE, Sidebar, Store, VERSION, WS_SERVER_URL, WS_URL, addParam, aiAgentCapabilitiesSchema, aiAgentSchema, apiFetch, type appFormData, appSchema, budgetCategory, capitalizeFirstLetter, checkIsExtension, checkThreadSummaryLimit, createApp, createCalendarEvent, createCustomAiAgentSchema, Chrry as default, deleteApp, deleteCalendarEvent, deleteMemories, deleteMessage, deleteSubscription, exampleInstructions, expenseCategory, type expenseCategoryType, exportToGoogleCalendar, extensionSuggestions, formatFileSize, generateAppMetadata, generateStoreMetadata, generateThreadMetadata, getActions, getApp, getApps, getBrowserAPI, getBrowserIdentity, getCalendarEvents, getDailyImageLimit, getEnv, getExampleInstructions, getExtensionUrl, getExtensionUrls, getFlag, getGuest, getHourlyLimit, getImageSrc, getInstructionConfig, getLastMessage, getMaxFileSize, getMetadata, getRedirectURL, getSession, getSlugFromPathname, getThread, getThreadId, getThreads, getTranslations, getUser, getUsers, getWeatherCacheTime, type instructionBase, isCI, isCollaborator, isDeepEqual, isDevelopment, isE2E, isFirefox, isOwner, isProduction, isSameDay, isTestingDevice, isTextFile, isValidUsername, isValidUuidV4, pageSizes, removeParam, removeUser, reorderApps, replaceLinks, storage, syncGoogleCalendar, updateApp, updateCalendarEvent, updateCollaboration, updateGuest, updateMessage, updateThread, updateUser, uploadUserImage, useAppMetadata, useComputedValue, useCookieOrLocalStorage, useCountdown, useDeviceInfo, useHasHydrated, useLocalStorage, usePWAInstall, useStoreMetadata, useSyncedState, useThreadMetadata, utcToday, validateFile };
package/dist/index.d.ts CHANGED
@@ -665,7 +665,8 @@ declare function replaceLinks({ text, pageUrl, }: {
665
665
  pageUrl?: string;
666
666
  }): Array<TextSegment>;
667
667
 
668
- declare const isCI: string | undefined;
668
+ declare const getEnv: () => any;
669
+ declare const isCI: boolean;
669
670
  declare const checkIsExtension: () => boolean;
670
671
  declare const getExtensionUrl: () => any;
671
672
  declare const isProduction: boolean;
@@ -825,21 +826,6 @@ declare function validateFile(file: File, capabilities?: AgentCapabilities, agen
825
826
  */
826
827
  declare function formatFileSize(bytes: number): string;
827
828
 
828
- /**
829
- * Get the appropriate API URL based on execution context
830
- * - Client-side (browser/extension): Use public URL through Cloudflare
831
- * - Server-side (SSR/API): Use internal localhost URL to avoid round-trip
832
- */
833
- declare function getApiUrl(options?: {
834
- forcePublic?: boolean;
835
- }): string;
836
- /**
837
- * Get the full API URL for a specific endpoint
838
- */
839
- declare function getApiEndpoint(path: string, options?: {
840
- forcePublic?: boolean;
841
- }): string;
842
-
843
829
  type BrowserAPIType = typeof chrome | typeof browser;
844
830
 
845
831
  declare const isSameDay: (date1: Date, date2: Date) => boolean;
@@ -857,13 +843,13 @@ declare const ADDITIONAL_CREDITS = 500;
857
843
  declare function isValidUuidV4(uuid: string): boolean;
858
844
  declare function getThreadId(pathname?: string): string | undefined;
859
845
  declare const MAX_TOOL_CALLS_PER_MESSAGE = 7;
860
- declare const WS_URL: string;
861
- declare const WS_SERVER_URL: string;
846
+ declare const WS_URL: any;
847
+ declare const WS_SERVER_URL: any;
862
848
  declare const addParam: (key: string, value: string) => void;
863
849
  declare const FRONTEND_URL: string;
864
850
  declare const PROD_FRONTEND_URL: string;
865
851
  declare const isE2E: boolean;
866
- declare const API_URL: string;
852
+ declare const API_URL: any;
867
853
  declare const apiFetch: (url: string, options?: RequestInit) => Promise<Response>;
868
854
  declare const PROMPT_LIMITS: {
869
855
  INPUT: number;
@@ -1915,4 +1901,4 @@ interface HistoryRouterProviderProps {
1915
1901
  */
1916
1902
  declare function HistoryRouterProvider({ children, }: HistoryRouterProviderProps): React.ReactElement;
1917
1903
 
1918
- export { ADDITIONAL_CREDITS, API_URL, type AgentCapabilities, type AgentModel, type AiAgent, type AiAgentCapabilities, type ApiActions, BrowserInstance, CHRRY_URL, CREDITS_PRICE, type CalendarEventFormData, Chrry, type CreateCustomAiAgent, FREE_DAYS, FRONTEND_URL, type FileValidationResult, GUEST_TASKS_COUNT, HistoryRouterProvider, MAX_FILE_LIMITS, MAX_FILE_SIZES, MAX_TOOL_CALLS_PER_MESSAGE, MEMBER_TASKS_COUNT, OWNER_CREDITS, PDF_LIMITS, PLUS_PRICE, PLUS_TASKS_COUNT, PROD_FRONTEND_URL, PROMPT_LIMITS, PRO_PRICE, Sidebar, Store, VERSION, WS_SERVER_URL, WS_URL, addParam, aiAgentCapabilitiesSchema, aiAgentSchema, apiFetch, type appFormData, appSchema, budgetCategory, capitalizeFirstLetter, checkIsExtension, checkThreadSummaryLimit, createApp, createCalendarEvent, createCustomAiAgentSchema, Chrry as default, deleteApp, deleteCalendarEvent, deleteMemories, deleteMessage, deleteSubscription, exampleInstructions, expenseCategory, type expenseCategoryType, exportToGoogleCalendar, extensionSuggestions, formatFileSize, generateAppMetadata, generateStoreMetadata, generateThreadMetadata, getActions, getApiEndpoint, getApiUrl, getApp, getApps, getBrowserAPI, getBrowserIdentity, getCalendarEvents, getDailyImageLimit, getExampleInstructions, getExtensionUrl, getExtensionUrls, getFlag, getGuest, getHourlyLimit, getImageSrc, getInstructionConfig, getLastMessage, getMaxFileSize, getMetadata, getRedirectURL, getSession, getSlugFromPathname, getThread, getThreadId, getThreads, getTranslations, getUser, getUsers, getWeatherCacheTime, type instructionBase, isCI, isCollaborator, isDeepEqual, isDevelopment, isE2E, isFirefox, isOwner, isProduction, isSameDay, isTestingDevice, isTextFile, isValidUsername, isValidUuidV4, pageSizes, removeParam, removeUser, reorderApps, replaceLinks, storage, syncGoogleCalendar, updateApp, updateCalendarEvent, updateCollaboration, updateGuest, updateMessage, updateThread, updateUser, uploadUserImage, useAppMetadata, useComputedValue, useCookieOrLocalStorage, useCountdown, useDeviceInfo, useHasHydrated, useLocalStorage, usePWAInstall, useStoreMetadata, useSyncedState, useThreadMetadata, utcToday, validateFile };
1904
+ export { ADDITIONAL_CREDITS, API_URL, type AgentCapabilities, type AgentModel, type AiAgent, type AiAgentCapabilities, type ApiActions, BrowserInstance, CHRRY_URL, CREDITS_PRICE, type CalendarEventFormData, Chrry, type CreateCustomAiAgent, FREE_DAYS, FRONTEND_URL, type FileValidationResult, GUEST_TASKS_COUNT, HistoryRouterProvider, MAX_FILE_LIMITS, MAX_FILE_SIZES, MAX_TOOL_CALLS_PER_MESSAGE, MEMBER_TASKS_COUNT, OWNER_CREDITS, PDF_LIMITS, PLUS_PRICE, PLUS_TASKS_COUNT, PROD_FRONTEND_URL, PROMPT_LIMITS, PRO_PRICE, Sidebar, Store, VERSION, WS_SERVER_URL, WS_URL, addParam, aiAgentCapabilitiesSchema, aiAgentSchema, apiFetch, type appFormData, appSchema, budgetCategory, capitalizeFirstLetter, checkIsExtension, checkThreadSummaryLimit, createApp, createCalendarEvent, createCustomAiAgentSchema, Chrry as default, deleteApp, deleteCalendarEvent, deleteMemories, deleteMessage, deleteSubscription, exampleInstructions, expenseCategory, type expenseCategoryType, exportToGoogleCalendar, extensionSuggestions, formatFileSize, generateAppMetadata, generateStoreMetadata, generateThreadMetadata, getActions, getApp, getApps, getBrowserAPI, getBrowserIdentity, getCalendarEvents, getDailyImageLimit, getEnv, getExampleInstructions, getExtensionUrl, getExtensionUrls, getFlag, getGuest, getHourlyLimit, getImageSrc, getInstructionConfig, getLastMessage, getMaxFileSize, getMetadata, getRedirectURL, getSession, getSlugFromPathname, getThread, getThreadId, getThreads, getTranslations, getUser, getUsers, getWeatherCacheTime, type instructionBase, isCI, isCollaborator, isDeepEqual, isDevelopment, isE2E, isFirefox, isOwner, isProduction, isSameDay, isTestingDevice, isTextFile, isValidUsername, isValidUuidV4, pageSizes, removeParam, removeUser, reorderApps, replaceLinks, storage, syncGoogleCalendar, updateApp, updateCalendarEvent, updateCollaboration, updateGuest, updateMessage, updateThread, updateUser, uploadUserImage, useAppMetadata, useComputedValue, useCookieOrLocalStorage, useCountdown, useDeviceInfo, useHasHydrated, useLocalStorage, usePWAInstall, useStoreMetadata, useSyncedState, useThreadMetadata, utcToday, validateFile };
package/dist/index.js CHANGED
@@ -34,6 +34,46 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  ));
35
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
+ // utils/env.ts
38
+ var import_meta, getEnv, isCI, checkIsExtension, getExtensionUrl, isProduction, isDevelopment, isTestingDevice;
39
+ var init_env = __esm({
40
+ "utils/env.ts"() {
41
+ "use strict";
42
+ import_meta = {};
43
+ getEnv = () => {
44
+ if (typeof import_meta !== "undefined") {
45
+ return import_meta.env;
46
+ }
47
+ return process.env;
48
+ };
49
+ isCI = getEnv().NEXT_PUBLIC_CI === "true" || getEnv().CI === "true";
50
+ checkIsExtension = () => {
51
+ if (typeof chrome !== "undefined" && chrome.runtime?.id) {
52
+ return true;
53
+ }
54
+ if (typeof browser !== "undefined" && browser.runtime?.id) {
55
+ return true;
56
+ }
57
+ return false;
58
+ };
59
+ getExtensionUrl = () => {
60
+ if (typeof window === "undefined") return;
61
+ if (typeof chrome !== "undefined" && chrome.runtime?.getURL) {
62
+ return chrome.runtime.getURL("index.html");
63
+ }
64
+ if (typeof browser !== "undefined" && browser.runtime?.getURL) {
65
+ return browser.runtime.getURL("index.html");
66
+ }
67
+ return `${window.location.origin}/index.html`;
68
+ };
69
+ isProduction = getEnv().NODE_ENV === "production" || getEnv().NEXT_PUBLIC_NODE_ENV === "production";
70
+ isDevelopment = checkIsExtension() ? ["bikahnjnakdnnccpnmcpmiojnehfooio"].some(
71
+ (id) => getExtensionUrl()?.includes(id)
72
+ ) : !isProduction;
73
+ isTestingDevice = false;
74
+ }
75
+ });
76
+
37
77
  // utils/isOwner.ts
38
78
  var isOwner, isOwner_default;
39
79
  var init_isOwner = __esm({
@@ -489,7 +529,7 @@ var init_locales = __esm({
489
529
 
490
530
  // utils/siteConfig.ts
491
531
  function detectSiteModeDomain(hostname2, mode) {
492
- const defaultMode = process.env.MODE || import_meta.env?.VITE_SITE_MODE || mode || "vex";
532
+ const defaultMode = process.env.MODE || import_meta2.env?.VITE_SITE_MODE || mode || "vex";
493
533
  const rawHost = hostname2 || (typeof window !== "undefined" ? window?.location?.hostname : "") || "";
494
534
  let host = rawHost?.trim().toLowerCase();
495
535
  if (host?.includes("://")) {
@@ -609,11 +649,11 @@ function getSiteConfig(hostnameOrMode) {
609
649
  }
610
650
  return vex;
611
651
  }
612
- var import_meta, chrryDev, chrryAI, focus, atlas, istanbul, amsterdam, tokyo, newYork, popcorn, zarathustra, vex, e2eVex, matchesDomain, whiteLabels;
652
+ var import_meta2, chrryDev, chrryAI, focus, atlas, istanbul, amsterdam, tokyo, newYork, popcorn, zarathustra, vex, e2eVex, matchesDomain, whiteLabels;
613
653
  var init_siteConfig = __esm({
614
654
  "utils/siteConfig.ts"() {
615
655
  "use strict";
616
- import_meta = {};
656
+ import_meta2 = {};
617
657
  chrryDev = {
618
658
  mode: "chrryDev",
619
659
  slug: "chrryDev",
@@ -1466,39 +1506,6 @@ var init_replaceLinks = __esm({
1466
1506
  }
1467
1507
  });
1468
1508
 
1469
- // utils/env.ts
1470
- var isCI, checkIsExtension, getExtensionUrl, isProduction, isDevelopment, isTestingDevice;
1471
- var init_env = __esm({
1472
- "utils/env.ts"() {
1473
- "use strict";
1474
- isCI = process.env.NEXT_PUBLIC_CI || process.env.CI;
1475
- checkIsExtension = () => {
1476
- if (typeof chrome !== "undefined" && chrome.runtime?.id) {
1477
- return true;
1478
- }
1479
- if (typeof browser !== "undefined" && browser.runtime?.id) {
1480
- return true;
1481
- }
1482
- return false;
1483
- };
1484
- getExtensionUrl = () => {
1485
- if (typeof window === "undefined") return;
1486
- if (typeof chrome !== "undefined" && chrome.runtime?.getURL) {
1487
- return chrome.runtime.getURL("index.html");
1488
- }
1489
- if (typeof browser !== "undefined" && browser.runtime?.getURL) {
1490
- return browser.runtime.getURL("index.html");
1491
- }
1492
- return `${window.location.origin}/index.html`;
1493
- };
1494
- isProduction = process.env.NODE_ENV === "production" || process.env.NEXT_PUBLIC_NODE_ENV === "production";
1495
- isDevelopment = checkIsExtension() ? ["bikahnjnakdnnccpnmcpmiojnehfooio"].some(
1496
- (id) => getExtensionUrl()?.includes(id)
1497
- ) : !isProduction;
1498
- isTestingDevice = false;
1499
- }
1500
- });
1501
-
1502
1509
  // utils/getHourlyLimit.ts
1503
1510
  var getHourlyLimit;
1504
1511
  var init_getHourlyLimit = __esm({
@@ -2843,28 +2850,6 @@ var init_fileValidation = __esm({
2843
2850
  }
2844
2851
  });
2845
2852
 
2846
- // utils/getApiUrl.ts
2847
- function getApiUrl(options) {
2848
- const isServer = typeof window === "undefined";
2849
- if (options?.forcePublic) {
2850
- return process.env.NEXT_PUBLIC_API_URL || process.env.API_URL || "https://chrry.dev/api";
2851
- }
2852
- if (isServer) {
2853
- return process.env.INTERNAL_API_URL || process.env.API_URL || "http://localhost:3001/api";
2854
- }
2855
- return process.env.NEXT_PUBLIC_API_URL || "https://chrry.dev/api";
2856
- }
2857
- function getApiEndpoint(path, options) {
2858
- const baseUrl = getApiUrl(options);
2859
- const cleanPath = path.startsWith("/") ? path.slice(1) : path;
2860
- return `${baseUrl}/${cleanPath}`;
2861
- }
2862
- var init_getApiUrl = __esm({
2863
- "utils/getApiUrl.ts"() {
2864
- "use strict";
2865
- }
2866
- });
2867
-
2868
2853
  // utils/index.ts
2869
2854
  function isValidUuidV4(uuid) {
2870
2855
  return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(
@@ -2927,6 +2912,7 @@ var init_utils = __esm({
2927
2912
  "utils/index.ts"() {
2928
2913
  "use strict";
2929
2914
  import_i18n_iso_countries = __toESM(require("i18n-iso-countries"));
2915
+ init_env();
2930
2916
  init_isOwner();
2931
2917
  init_getExampleInstructions();
2932
2918
  init_getWeatherCacheTime();
@@ -2941,7 +2927,6 @@ var init_utils = __esm({
2941
2927
  init_generateStoreMetadata();
2942
2928
  init_generateThreadMetadata();
2943
2929
  init_fileValidation();
2944
- init_getApiUrl();
2945
2930
  isSameDay = (date1, date2) => {
2946
2931
  return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
2947
2932
  };
@@ -2955,15 +2940,15 @@ var init_utils = __esm({
2955
2940
  return void 0;
2956
2941
  };
2957
2942
  hostname = getClientHostname();
2958
- CHRRY_URL = hostname ? getSiteConfig(hostname).url : isDevelopment ? `http://localhost:${typeof process !== "undefined" && process.env?.NEXT_PUBLIC_FE_PORT || "5173"}` : "https://vex.chrry.ai";
2943
+ CHRRY_URL = hostname ? getSiteConfig(hostname).url : "https://vex.chrry.ai";
2959
2944
  FREE_DAYS = 5;
2960
2945
  PLUS_PRICE = 9.99;
2961
2946
  PRO_PRICE = 19.99;
2962
2947
  CREDITS_PRICE = 5;
2963
2948
  ADDITIONAL_CREDITS = 500;
2964
2949
  MAX_TOOL_CALLS_PER_MESSAGE = 7;
2965
- WS_URL = process.env.NEXT_PUBLIC_WS_URL || (isTestingDevice ? "ws://192.168.2.27:5001" : isDevelopment ? "ws://localhost:5001" : "wss://ws.chrry.dev");
2966
- WS_SERVER_URL = process.env.NEXT_PUBLIC_WS_SERVER_URL || process.env.WS_SERVER_URL || "http://127.0.0.1:5001";
2950
+ WS_URL = getEnv().VITE_WS_URL || (isTestingDevice ? "ws://192.168.2.27:5001" : isDevelopment ? "ws://localhost:5001" : "wss://ws.chrry.dev");
2951
+ WS_SERVER_URL = getEnv().VITE_WS_SERVER_URL || getEnv().WS_SERVER_URL || "http://127.0.0.1:5001";
2967
2952
  addParam = (key, value) => {
2968
2953
  if (typeof window === "undefined") return;
2969
2954
  const searchParams = new URLSearchParams(window.location.search);
@@ -2971,12 +2956,12 @@ var init_utils = __esm({
2971
2956
  const newUrl = searchParams.toString() ? `?${searchParams.toString()}` : window.location.pathname;
2972
2957
  window.history.replaceState({}, "", newUrl);
2973
2958
  };
2974
- FE_PORT = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_FE_PORT || "5173";
2975
- API_PORT = typeof process !== "undefined" && process.env?.API_PORT || "3001";
2959
+ FE_PORT = getEnv().VITE_FE_PORT || "5173";
2960
+ API_PORT = getEnv().API_PORT || "3001";
2976
2961
  FRONTEND_URL = isTestingDevice ? `http://192.168.2.27:${FE_PORT}` : isDevelopment ? `http://localhost:${FE_PORT}` : CHRRY_URL;
2977
2962
  PROD_FRONTEND_URL = CHRRY_URL;
2978
- isE2E = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e" || process.env.TESTING_ENV === "e2e";
2979
- API_URL = process.env.NEXT_PUBLIC_API_URL || (isTestingDevice ? `http://192.168.2.27:${API_PORT}/api` : isDevelopment ? `http://localhost:${API_PORT}/api` : isE2E ? "https://e2e.chrry.dev/api" : "https://chrry.dev/api");
2963
+ isE2E = getEnv().VITE_TESTING_ENV === "e2e" || getEnv().TESTING_ENV === "e2e";
2964
+ API_URL = getEnv().VITE_API_URL || (isTestingDevice ? `http://192.168.2.27:${API_PORT}/api` : isDevelopment ? `http://localhost:${API_PORT}/api` : isE2E ? "https://e2e.chrry.dev/api" : "https://chrry.dev/api");
2980
2965
  apiFetch = (url, options) => {
2981
2966
  return fetch(url, {
2982
2967
  ...options,
@@ -3156,7 +3141,7 @@ var init_utils = __esm({
3156
3141
  };
3157
3142
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3158
3143
  config = getSiteConfig(getClientHostname());
3159
- VERSION = config.version || "1.6.91";
3144
+ VERSION = config.version || "1.6.87";
3160
3145
  getSlugFromPathname = (path) => {
3161
3146
  return getAppAndStoreSlugs(path, {
3162
3147
  defaultAppSlug: config.slug,
@@ -23652,7 +23637,6 @@ function AuthProvider({
23652
23637
  fetchSession();
23653
23638
  };
23654
23639
  const [threads, setThreads] = (0, import_react20.useState)(props.threads);
23655
- const isCI2 = process.env.NEXT_PUBLIC_CI === "true";
23656
23640
  const siteConfig = getSiteConfig(CHRRY_URL);
23657
23641
  const chrryUrl = CHRRY_URL;
23658
23642
  const [deviceId, setDeviceId] = useCookieOrLocalStorage(
@@ -24574,7 +24558,7 @@ function AuthProvider({
24574
24558
  user,
24575
24559
  setUser,
24576
24560
  setGuest,
24577
- isCI: isCI2,
24561
+ isCI,
24578
24562
  baseApp,
24579
24563
  hasNotification,
24580
24564
  guest,
@@ -24706,7 +24690,7 @@ function DataProvider({ children, ...rest }) {
24706
24690
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24707
24691
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24708
24692
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24709
- const VERSION4 = "1.6.91";
24693
+ const VERSION4 = "1.6.92";
24710
24694
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24711
24695
  const {
24712
24696
  API_URL: API_URL2,
@@ -24887,12 +24871,10 @@ function DataProvider({ children, ...rest }) {
24887
24871
  temperature: `${unit === "F" ? weatherData.current.temp_f : weatherData.current.temp_c}\xB0${unit}`,
24888
24872
  condition: weatherData.current.condition.text,
24889
24873
  code: weatherData.current.condition.code,
24890
- createdOn: /* @__PURE__ */ new Date(),
24891
- lastUpdated: weatherData.current.last_updated
24874
+ createdOn: /* @__PURE__ */ new Date()
24892
24875
  });
24893
24876
  }
24894
24877
  }, [weatherData]);
24895
- const isE2E3 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
24896
24878
  const [aiAgents, setAiAgents] = (0, import_react21.useState)(session2?.aiAgents || []);
24897
24879
  const { data: aiAgentsData } = (0, import_swr2.default)(
24898
24880
  siteConfig.mode !== "chrryDev" && aiAgents?.length > 0 ? null : token && ["aiAgents", token, app?.id],
@@ -24948,7 +24930,7 @@ function DataProvider({ children, ...rest }) {
24948
24930
  refetchWeather,
24949
24931
  env,
24950
24932
  setEnv,
24951
- isDevelopment: isDevelopment2,
24933
+ isDevelopment,
24952
24934
  API_URL: API_URL2,
24953
24935
  WS_URL: WS_URL2,
24954
24936
  TEST_GUEST_FINGERPRINTS,
@@ -24960,7 +24942,7 @@ function DataProvider({ children, ...rest }) {
24960
24942
  PROD_FRONTEND_URL: PROD_FRONTEND_URL2,
24961
24943
  MONTHLY_GUEST_CREDITS,
24962
24944
  actions,
24963
- isE2E: isE2E3,
24945
+ isE2E,
24964
24946
  pageSizes: pageSizes3,
24965
24947
  setNeedsUpdateModalOpen,
24966
24948
  needsUpdateModalOpen,
@@ -24978,7 +24960,7 @@ function useData() {
24978
24960
  }
24979
24961
  return context;
24980
24962
  }
24981
- var import_react21, import_swr2, DataContext, isProduction2, isExtension, extensionId, isDevelopment2, MONTHLY_GUEST_CREDITS;
24963
+ var import_react21, import_swr2, DataContext, isExtension, extensionId, MONTHLY_GUEST_CREDITS;
24982
24964
  var init_DataProvider = __esm({
24983
24965
  "context/providers/DataProvider.tsx"() {
24984
24966
  "use strict";
@@ -24994,10 +24976,8 @@ var init_DataProvider = __esm({
24994
24976
  init_siteConfig();
24995
24977
  init_utils();
24996
24978
  DataContext = (0, import_react21.createContext)(void 0);
24997
- isProduction2 = process.env.NEXT_PUBLIC_NODE_ENV === "production";
24998
24979
  isExtension = isBrowserExtension();
24999
24980
  extensionId = getExtensionId();
25000
- isDevelopment2 = isExtension ? ["ihkpepnfnhmdkmpgfdnfbllldbgabbad"].includes(extensionId || "") : !isProduction2;
25001
24981
  MONTHLY_GUEST_CREDITS = 30;
25002
24982
  }
25003
24983
  });
@@ -27003,8 +26983,8 @@ function ChatProvider({
27003
26983
  setSelectedAgent(a);
27004
26984
  setDebateAgent(null);
27005
26985
  }, [app, aiAgents]);
27006
- const { isDevelopment: isDevelopment3, isE2E: isE2E3, actions } = useData();
27007
- const hourlyLimit = isDevelopment3 && !isE2E3 ? 5e4 : getHourlyLimit({
26986
+ const { isDevelopment: isDevelopment2, isE2E: isE2E3, actions } = useData();
26987
+ const hourlyLimit = isDevelopment2 && !isE2E3 ? 5e4 : getHourlyLimit({
27008
26988
  member: user,
27009
26989
  guest
27010
26990
  });
@@ -28360,6 +28340,7 @@ var init_AppContext = __esm({
28360
28340
  init_ThemeContext();
28361
28341
  init_providers();
28362
28342
  init_siteConfig();
28343
+ init_utils();
28363
28344
  reportedMissingKeys = /* @__PURE__ */ new Set();
28364
28345
  checkedKeys = /* @__PURE__ */ new Set();
28365
28346
  AppContext = (0, import_react33.createContext)({
@@ -28372,12 +28353,10 @@ var init_AppContext = __esm({
28372
28353
  }) => {
28373
28354
  const { t: i18nT } = (0, import_react_i18next4.useTranslation)();
28374
28355
  const { user, storeApps, atlas: atlas2 } = useAuth();
28375
- const isE2E3 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
28376
- const isCI2 = process.env.NEXT_PUBLIC_CI === "true";
28377
28356
  const config2 = getSiteConfig();
28378
28357
  const t5 = (key, values, autoAdd = true) => {
28379
28358
  const result = i18nT(key, values);
28380
- if (autoAdd && !isCI2 && isE2E3 && user?.role === "admin" && typeof window !== "undefined" && !checkedKeys.has(key)) {
28359
+ if (autoAdd && !isCI && isE2E && user?.role === "admin" && typeof window !== "undefined" && !checkedKeys.has(key)) {
28381
28360
  checkedKeys.add(key);
28382
28361
  if (result === key && !reportedMissingKeys.has(key)) {
28383
28362
  reportedMissingKeys.add(key);
@@ -31702,7 +31681,6 @@ function EnableNotifications({
31702
31681
  const [isSubscribed, setIsSubscribed] = (0, import_react42.useState)(
31703
31682
  void 0
31704
31683
  );
31705
- console.log(`\u{1F680} ~ isSubscribed:`, isSubscribed);
31706
31684
  async function addPushSubscription(subscription, p256dh, auth) {
31707
31685
  const response = await apiFetch(`${API_URL2}/pushSubscriptions`, {
31708
31686
  method: "POST",
@@ -31784,10 +31762,6 @@ function EnableNotifications({
31784
31762
  }
31785
31763
  const registration = await registerServiceWorker_default2();
31786
31764
  if (registration) {
31787
- console.log(
31788
- `\u{1F680} ~ initializeServiceWorker ~ registration:`,
31789
- registration
31790
- );
31791
31765
  setSwRegistration(registration);
31792
31766
  setIsSubscribed(false);
31793
31767
  }
@@ -31817,7 +31791,7 @@ function EnableNotifications({
31817
31791
  return;
31818
31792
  }
31819
31793
  if (swRegistration && !pushSubscription) {
31820
- const publicVapidKey = process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY;
31794
+ const publicVapidKey = getEnv().NEXT_PUBLIC_VAPID_PUBLIC_KEY;
31821
31795
  const subscription = await subscribeToPushNotifications(
31822
31796
  swRegistration,
31823
31797
  publicVapidKey
@@ -66763,14 +66737,13 @@ __export(index_exports, {
66763
66737
  generateStoreMetadata: () => generateStoreMetadata,
66764
66738
  generateThreadMetadata: () => generateThreadMetadata,
66765
66739
  getActions: () => getActions,
66766
- getApiEndpoint: () => getApiEndpoint,
66767
- getApiUrl: () => getApiUrl,
66768
66740
  getApp: () => getApp,
66769
66741
  getApps: () => getApps,
66770
66742
  getBrowserAPI: () => getBrowserAPI,
66771
66743
  getBrowserIdentity: () => getBrowserIdentity,
66772
66744
  getCalendarEvents: () => getCalendarEvents,
66773
66745
  getDailyImageLimit: () => getDailyImageLimit,
66746
+ getEnv: () => getEnv,
66774
66747
  getExampleInstructions: () => getExampleInstructions,
66775
66748
  getExtensionUrl: () => getExtensionUrl,
66776
66749
  getExtensionUrls: () => getExtensionUrls,
@@ -67003,14 +66976,13 @@ function HistoryRouterProvider({
67003
66976
  generateStoreMetadata,
67004
66977
  generateThreadMetadata,
67005
66978
  getActions,
67006
- getApiEndpoint,
67007
- getApiUrl,
67008
66979
  getApp,
67009
66980
  getApps,
67010
66981
  getBrowserAPI,
67011
66982
  getBrowserIdentity,
67012
66983
  getCalendarEvents,
67013
66984
  getDailyImageLimit,
66985
+ getEnv,
67014
66986
  getExampleInstructions,
67015
66987
  getExtensionUrl,
67016
66988
  getExtensionUrls,