@chrryai/chrry 1.6.91 → 1.6.93
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 +6 -20
- package/dist/index.d.ts +6 -20
- package/dist/index.js +64 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -86
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
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:
|
|
861
|
-
declare const WS_SERVER_URL:
|
|
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:
|
|
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,
|
|
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
|
|
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:
|
|
861
|
-
declare const WS_SERVER_URL:
|
|
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:
|
|
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,
|
|
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 ||
|
|
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
|
|
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
|
-
|
|
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 :
|
|
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 =
|
|
2966
|
-
WS_SERVER_URL =
|
|
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 =
|
|
2975
|
-
API_PORT =
|
|
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 =
|
|
2979
|
-
API_URL =
|
|
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.
|
|
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
|
|
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.
|
|
24693
|
+
const VERSION4 = "1.6.93";
|
|
24710
24694
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24711
24695
|
const {
|
|
24712
24696
|
API_URL: API_URL2,
|
|
@@ -24892,7 +24876,6 @@ function DataProvider({ children, ...rest }) {
|
|
|
24892
24876
|
});
|
|
24893
24877
|
}
|
|
24894
24878
|
}, [weatherData]);
|
|
24895
|
-
const isE2E3 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
|
|
24896
24879
|
const [aiAgents, setAiAgents] = (0, import_react21.useState)(session2?.aiAgents || []);
|
|
24897
24880
|
const { data: aiAgentsData } = (0, import_swr2.default)(
|
|
24898
24881
|
siteConfig.mode !== "chrryDev" && aiAgents?.length > 0 ? null : token && ["aiAgents", token, app?.id],
|
|
@@ -24948,7 +24931,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24948
24931
|
refetchWeather,
|
|
24949
24932
|
env,
|
|
24950
24933
|
setEnv,
|
|
24951
|
-
isDevelopment
|
|
24934
|
+
isDevelopment,
|
|
24952
24935
|
API_URL: API_URL2,
|
|
24953
24936
|
WS_URL: WS_URL2,
|
|
24954
24937
|
TEST_GUEST_FINGERPRINTS,
|
|
@@ -24960,7 +24943,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24960
24943
|
PROD_FRONTEND_URL: PROD_FRONTEND_URL2,
|
|
24961
24944
|
MONTHLY_GUEST_CREDITS,
|
|
24962
24945
|
actions,
|
|
24963
|
-
isE2E
|
|
24946
|
+
isE2E,
|
|
24964
24947
|
pageSizes: pageSizes3,
|
|
24965
24948
|
setNeedsUpdateModalOpen,
|
|
24966
24949
|
needsUpdateModalOpen,
|
|
@@ -24978,7 +24961,7 @@ function useData() {
|
|
|
24978
24961
|
}
|
|
24979
24962
|
return context;
|
|
24980
24963
|
}
|
|
24981
|
-
var import_react21, import_swr2, DataContext,
|
|
24964
|
+
var import_react21, import_swr2, DataContext, isExtension, extensionId, MONTHLY_GUEST_CREDITS;
|
|
24982
24965
|
var init_DataProvider = __esm({
|
|
24983
24966
|
"context/providers/DataProvider.tsx"() {
|
|
24984
24967
|
"use strict";
|
|
@@ -24994,10 +24977,8 @@ var init_DataProvider = __esm({
|
|
|
24994
24977
|
init_siteConfig();
|
|
24995
24978
|
init_utils();
|
|
24996
24979
|
DataContext = (0, import_react21.createContext)(void 0);
|
|
24997
|
-
isProduction2 = process.env.NEXT_PUBLIC_NODE_ENV === "production";
|
|
24998
24980
|
isExtension = isBrowserExtension();
|
|
24999
24981
|
extensionId = getExtensionId();
|
|
25000
|
-
isDevelopment2 = isExtension ? ["ihkpepnfnhmdkmpgfdnfbllldbgabbad"].includes(extensionId || "") : !isProduction2;
|
|
25001
24982
|
MONTHLY_GUEST_CREDITS = 30;
|
|
25002
24983
|
}
|
|
25003
24984
|
});
|
|
@@ -27003,8 +26984,8 @@ function ChatProvider({
|
|
|
27003
26984
|
setSelectedAgent(a);
|
|
27004
26985
|
setDebateAgent(null);
|
|
27005
26986
|
}, [app, aiAgents]);
|
|
27006
|
-
const { isDevelopment:
|
|
27007
|
-
const hourlyLimit =
|
|
26987
|
+
const { isDevelopment: isDevelopment2, isE2E: isE2E3, actions } = useData();
|
|
26988
|
+
const hourlyLimit = isDevelopment2 && !isE2E3 ? 5e4 : getHourlyLimit({
|
|
27008
26989
|
member: user,
|
|
27009
26990
|
guest
|
|
27010
26991
|
});
|
|
@@ -28360,6 +28341,7 @@ var init_AppContext = __esm({
|
|
|
28360
28341
|
init_ThemeContext();
|
|
28361
28342
|
init_providers();
|
|
28362
28343
|
init_siteConfig();
|
|
28344
|
+
init_utils();
|
|
28363
28345
|
reportedMissingKeys = /* @__PURE__ */ new Set();
|
|
28364
28346
|
checkedKeys = /* @__PURE__ */ new Set();
|
|
28365
28347
|
AppContext = (0, import_react33.createContext)({
|
|
@@ -28372,12 +28354,10 @@ var init_AppContext = __esm({
|
|
|
28372
28354
|
}) => {
|
|
28373
28355
|
const { t: i18nT } = (0, import_react_i18next4.useTranslation)();
|
|
28374
28356
|
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
28357
|
const config2 = getSiteConfig();
|
|
28378
28358
|
const t5 = (key, values, autoAdd = true) => {
|
|
28379
28359
|
const result = i18nT(key, values);
|
|
28380
|
-
if (autoAdd && !
|
|
28360
|
+
if (autoAdd && !isCI && isE2E && user?.role === "admin" && typeof window !== "undefined" && !checkedKeys.has(key)) {
|
|
28381
28361
|
checkedKeys.add(key);
|
|
28382
28362
|
if (result === key && !reportedMissingKeys.has(key)) {
|
|
28383
28363
|
reportedMissingKeys.add(key);
|
|
@@ -31702,7 +31682,6 @@ function EnableNotifications({
|
|
|
31702
31682
|
const [isSubscribed, setIsSubscribed] = (0, import_react42.useState)(
|
|
31703
31683
|
void 0
|
|
31704
31684
|
);
|
|
31705
|
-
console.log(`\u{1F680} ~ isSubscribed:`, isSubscribed);
|
|
31706
31685
|
async function addPushSubscription(subscription, p256dh, auth) {
|
|
31707
31686
|
const response = await apiFetch(`${API_URL2}/pushSubscriptions`, {
|
|
31708
31687
|
method: "POST",
|
|
@@ -31784,10 +31763,6 @@ function EnableNotifications({
|
|
|
31784
31763
|
}
|
|
31785
31764
|
const registration = await registerServiceWorker_default2();
|
|
31786
31765
|
if (registration) {
|
|
31787
|
-
console.log(
|
|
31788
|
-
`\u{1F680} ~ initializeServiceWorker ~ registration:`,
|
|
31789
|
-
registration
|
|
31790
|
-
);
|
|
31791
31766
|
setSwRegistration(registration);
|
|
31792
31767
|
setIsSubscribed(false);
|
|
31793
31768
|
}
|
|
@@ -31817,7 +31792,7 @@ function EnableNotifications({
|
|
|
31817
31792
|
return;
|
|
31818
31793
|
}
|
|
31819
31794
|
if (swRegistration && !pushSubscription) {
|
|
31820
|
-
const publicVapidKey =
|
|
31795
|
+
const publicVapidKey = getEnv().NEXT_PUBLIC_VAPID_PUBLIC_KEY;
|
|
31821
31796
|
const subscription = await subscribeToPushNotifications(
|
|
31822
31797
|
swRegistration,
|
|
31823
31798
|
publicVapidKey
|
|
@@ -66763,14 +66738,13 @@ __export(index_exports, {
|
|
|
66763
66738
|
generateStoreMetadata: () => generateStoreMetadata,
|
|
66764
66739
|
generateThreadMetadata: () => generateThreadMetadata,
|
|
66765
66740
|
getActions: () => getActions,
|
|
66766
|
-
getApiEndpoint: () => getApiEndpoint,
|
|
66767
|
-
getApiUrl: () => getApiUrl,
|
|
66768
66741
|
getApp: () => getApp,
|
|
66769
66742
|
getApps: () => getApps,
|
|
66770
66743
|
getBrowserAPI: () => getBrowserAPI,
|
|
66771
66744
|
getBrowserIdentity: () => getBrowserIdentity,
|
|
66772
66745
|
getCalendarEvents: () => getCalendarEvents,
|
|
66773
66746
|
getDailyImageLimit: () => getDailyImageLimit,
|
|
66747
|
+
getEnv: () => getEnv,
|
|
66774
66748
|
getExampleInstructions: () => getExampleInstructions,
|
|
66775
66749
|
getExtensionUrl: () => getExtensionUrl,
|
|
66776
66750
|
getExtensionUrls: () => getExtensionUrls,
|
|
@@ -67003,14 +66977,13 @@ function HistoryRouterProvider({
|
|
|
67003
66977
|
generateStoreMetadata,
|
|
67004
66978
|
generateThreadMetadata,
|
|
67005
66979
|
getActions,
|
|
67006
|
-
getApiEndpoint,
|
|
67007
|
-
getApiUrl,
|
|
67008
66980
|
getApp,
|
|
67009
66981
|
getApps,
|
|
67010
66982
|
getBrowserAPI,
|
|
67011
66983
|
getBrowserIdentity,
|
|
67012
66984
|
getCalendarEvents,
|
|
67013
66985
|
getDailyImageLimit,
|
|
66986
|
+
getEnv,
|
|
67014
66987
|
getExampleInstructions,
|
|
67015
66988
|
getExtensionUrl,
|
|
67016
66989
|
getExtensionUrls,
|