@chrryai/chrry 1.6.90 → 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 +6 -20
- package/dist/index.d.ts +6 -20
- package/dist/index.js +86 -148
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -143
- 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,
|
|
@@ -6162,47 +6147,32 @@ var init_useWindowHistory = __esm({
|
|
|
6162
6147
|
|
|
6163
6148
|
// platform/navigation.web.ts
|
|
6164
6149
|
function useNavigation() {
|
|
6165
|
-
const
|
|
6166
|
-
const
|
|
6167
|
-
const searchParams = useNextSearchParams?.() || useSearchParams();
|
|
6150
|
+
const pathname = usePathname();
|
|
6151
|
+
const searchParams = useSearchParams();
|
|
6168
6152
|
const clientRouter2 = useRouter();
|
|
6169
6153
|
const push = (0, import_react17.useCallback)(
|
|
6170
6154
|
(path, options) => {
|
|
6171
|
-
|
|
6172
|
-
if (useClientOnly) {
|
|
6173
|
-
clientRouter2.push(path, { scroll: options?.scroll });
|
|
6174
|
-
} else {
|
|
6175
|
-
nextRouter?.push(path, { scroll: options?.scroll });
|
|
6176
|
-
}
|
|
6155
|
+
clientRouter2.push(path, { scroll: options?.scroll });
|
|
6177
6156
|
},
|
|
6178
|
-
[
|
|
6157
|
+
[clientRouter2]
|
|
6179
6158
|
);
|
|
6180
6159
|
const replace = (0, import_react17.useCallback)(
|
|
6181
6160
|
(path, options) => {
|
|
6182
|
-
|
|
6183
|
-
if (useClientOnly) {
|
|
6184
|
-
clientRouter2.replace(path, { scroll: options?.scroll });
|
|
6185
|
-
} else {
|
|
6186
|
-
nextRouter?.replace(path, { scroll: options?.scroll });
|
|
6187
|
-
}
|
|
6161
|
+
clientRouter2.replace(path, { scroll: options?.scroll });
|
|
6188
6162
|
},
|
|
6189
|
-
[
|
|
6163
|
+
[clientRouter2]
|
|
6190
6164
|
);
|
|
6191
6165
|
const back = (0, import_react17.useCallback)(() => {
|
|
6192
|
-
|
|
6193
|
-
}, [
|
|
6166
|
+
clientRouter2.back();
|
|
6167
|
+
}, [clientRouter2]);
|
|
6194
6168
|
const forward = (0, import_react17.useCallback)(() => {
|
|
6195
|
-
|
|
6196
|
-
}, [
|
|
6169
|
+
clientRouter2.forward();
|
|
6170
|
+
}, [clientRouter2]);
|
|
6197
6171
|
const refresh = (0, import_react17.useCallback)(() => {
|
|
6198
|
-
|
|
6199
|
-
}, [
|
|
6200
|
-
const prefetch = (0, import_react17.useCallback)(
|
|
6201
|
-
|
|
6202
|
-
nextRouter?.prefetch(path);
|
|
6203
|
-
},
|
|
6204
|
-
[nextRouter]
|
|
6205
|
-
);
|
|
6172
|
+
window.location.reload();
|
|
6173
|
+
}, []);
|
|
6174
|
+
const prefetch = (0, import_react17.useCallback)((path) => {
|
|
6175
|
+
}, []);
|
|
6206
6176
|
const addParams = (0, import_react17.useCallback)(
|
|
6207
6177
|
(params) => {
|
|
6208
6178
|
const newSearchParams = new URLSearchParams(searchParams?.toString());
|
|
@@ -6211,13 +6181,9 @@ function useNavigation() {
|
|
|
6211
6181
|
});
|
|
6212
6182
|
const queryString = newSearchParams.toString();
|
|
6213
6183
|
const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
|
|
6214
|
-
|
|
6215
|
-
nextRouter.push(newUrl);
|
|
6216
|
-
} else {
|
|
6217
|
-
clientRouter2.push(newUrl);
|
|
6218
|
-
}
|
|
6184
|
+
clientRouter2.push(newUrl);
|
|
6219
6185
|
},
|
|
6220
|
-
[
|
|
6186
|
+
[clientRouter2, pathname, searchParams]
|
|
6221
6187
|
);
|
|
6222
6188
|
const removeParams = (0, import_react17.useCallback)(
|
|
6223
6189
|
(keys) => {
|
|
@@ -6226,13 +6192,9 @@ function useNavigation() {
|
|
|
6226
6192
|
keysArray.forEach((key) => newSearchParams.delete(key));
|
|
6227
6193
|
const queryString = newSearchParams.toString();
|
|
6228
6194
|
const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
|
|
6229
|
-
|
|
6230
|
-
nextRouter.push(newUrl);
|
|
6231
|
-
} else {
|
|
6232
|
-
clientRouter2.push(newUrl);
|
|
6233
|
-
}
|
|
6195
|
+
clientRouter2.push(newUrl);
|
|
6234
6196
|
},
|
|
6235
|
-
[
|
|
6197
|
+
[clientRouter2, pathname, searchParams]
|
|
6236
6198
|
);
|
|
6237
6199
|
const setParams = (0, import_react17.useCallback)(
|
|
6238
6200
|
(params) => {
|
|
@@ -6242,13 +6204,9 @@ function useNavigation() {
|
|
|
6242
6204
|
});
|
|
6243
6205
|
const queryString = newSearchParams.toString();
|
|
6244
6206
|
const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
|
|
6245
|
-
|
|
6246
|
-
nextRouter.push(newUrl);
|
|
6247
|
-
} else {
|
|
6248
|
-
clientRouter2.push(newUrl);
|
|
6249
|
-
}
|
|
6207
|
+
clientRouter2.push(newUrl);
|
|
6250
6208
|
},
|
|
6251
|
-
[
|
|
6209
|
+
[clientRouter2, pathname]
|
|
6252
6210
|
);
|
|
6253
6211
|
return (0, import_react17.useMemo)(
|
|
6254
6212
|
() => ({
|
|
@@ -6282,19 +6240,12 @@ function useNavigation() {
|
|
|
6282
6240
|
function usePreviousPathname() {
|
|
6283
6241
|
return null;
|
|
6284
6242
|
}
|
|
6285
|
-
var import_react17
|
|
6243
|
+
var import_react17;
|
|
6286
6244
|
var init_navigation_web = __esm({
|
|
6287
6245
|
"platform/navigation.web.ts"() {
|
|
6288
6246
|
"use strict";
|
|
6289
6247
|
import_react17 = __toESM(require("react"));
|
|
6290
6248
|
init_useWindowHistory();
|
|
6291
|
-
try {
|
|
6292
|
-
const nextNavigation = require("next/navigation");
|
|
6293
|
-
useNextRouter = nextNavigation.useRouter;
|
|
6294
|
-
useNextPathname = nextNavigation.usePathname;
|
|
6295
|
-
useNextSearchParams = nextNavigation.useSearchParams;
|
|
6296
|
-
} catch {
|
|
6297
|
-
}
|
|
6298
6249
|
}
|
|
6299
6250
|
});
|
|
6300
6251
|
|
|
@@ -23686,7 +23637,6 @@ function AuthProvider({
|
|
|
23686
23637
|
fetchSession();
|
|
23687
23638
|
};
|
|
23688
23639
|
const [threads, setThreads] = (0, import_react20.useState)(props.threads);
|
|
23689
|
-
const isCI2 = process.env.NEXT_PUBLIC_CI === "true";
|
|
23690
23640
|
const siteConfig = getSiteConfig(CHRRY_URL);
|
|
23691
23641
|
const chrryUrl = CHRRY_URL;
|
|
23692
23642
|
const [deviceId, setDeviceId] = useCookieOrLocalStorage(
|
|
@@ -24608,7 +24558,7 @@ function AuthProvider({
|
|
|
24608
24558
|
user,
|
|
24609
24559
|
setUser,
|
|
24610
24560
|
setGuest,
|
|
24611
|
-
isCI
|
|
24561
|
+
isCI,
|
|
24612
24562
|
baseApp,
|
|
24613
24563
|
hasNotification,
|
|
24614
24564
|
guest,
|
|
@@ -24740,7 +24690,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24740
24690
|
const [instructions, setInstructions] = (0, import_react21.useState)([]);
|
|
24741
24691
|
const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
|
|
24742
24692
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
|
|
24743
|
-
const VERSION4 = "1.6.
|
|
24693
|
+
const VERSION4 = "1.6.92";
|
|
24744
24694
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24745
24695
|
const {
|
|
24746
24696
|
API_URL: API_URL2,
|
|
@@ -24921,12 +24871,10 @@ function DataProvider({ children, ...rest }) {
|
|
|
24921
24871
|
temperature: `${unit === "F" ? weatherData.current.temp_f : weatherData.current.temp_c}\xB0${unit}`,
|
|
24922
24872
|
condition: weatherData.current.condition.text,
|
|
24923
24873
|
code: weatherData.current.condition.code,
|
|
24924
|
-
createdOn: /* @__PURE__ */ new Date()
|
|
24925
|
-
lastUpdated: weatherData.current.last_updated
|
|
24874
|
+
createdOn: /* @__PURE__ */ new Date()
|
|
24926
24875
|
});
|
|
24927
24876
|
}
|
|
24928
24877
|
}, [weatherData]);
|
|
24929
|
-
const isE2E3 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
|
|
24930
24878
|
const [aiAgents, setAiAgents] = (0, import_react21.useState)(session2?.aiAgents || []);
|
|
24931
24879
|
const { data: aiAgentsData } = (0, import_swr2.default)(
|
|
24932
24880
|
siteConfig.mode !== "chrryDev" && aiAgents?.length > 0 ? null : token && ["aiAgents", token, app?.id],
|
|
@@ -24982,7 +24930,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24982
24930
|
refetchWeather,
|
|
24983
24931
|
env,
|
|
24984
24932
|
setEnv,
|
|
24985
|
-
isDevelopment
|
|
24933
|
+
isDevelopment,
|
|
24986
24934
|
API_URL: API_URL2,
|
|
24987
24935
|
WS_URL: WS_URL2,
|
|
24988
24936
|
TEST_GUEST_FINGERPRINTS,
|
|
@@ -24994,7 +24942,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24994
24942
|
PROD_FRONTEND_URL: PROD_FRONTEND_URL2,
|
|
24995
24943
|
MONTHLY_GUEST_CREDITS,
|
|
24996
24944
|
actions,
|
|
24997
|
-
isE2E
|
|
24945
|
+
isE2E,
|
|
24998
24946
|
pageSizes: pageSizes3,
|
|
24999
24947
|
setNeedsUpdateModalOpen,
|
|
25000
24948
|
needsUpdateModalOpen,
|
|
@@ -25012,7 +24960,7 @@ function useData() {
|
|
|
25012
24960
|
}
|
|
25013
24961
|
return context;
|
|
25014
24962
|
}
|
|
25015
|
-
var import_react21, import_swr2, DataContext,
|
|
24963
|
+
var import_react21, import_swr2, DataContext, isExtension, extensionId, MONTHLY_GUEST_CREDITS;
|
|
25016
24964
|
var init_DataProvider = __esm({
|
|
25017
24965
|
"context/providers/DataProvider.tsx"() {
|
|
25018
24966
|
"use strict";
|
|
@@ -25028,10 +24976,8 @@ var init_DataProvider = __esm({
|
|
|
25028
24976
|
init_siteConfig();
|
|
25029
24977
|
init_utils();
|
|
25030
24978
|
DataContext = (0, import_react21.createContext)(void 0);
|
|
25031
|
-
isProduction2 = process.env.NEXT_PUBLIC_NODE_ENV === "production";
|
|
25032
24979
|
isExtension = isBrowserExtension();
|
|
25033
24980
|
extensionId = getExtensionId();
|
|
25034
|
-
isDevelopment2 = isExtension ? ["ihkpepnfnhmdkmpgfdnfbllldbgabbad"].includes(extensionId || "") : !isProduction2;
|
|
25035
24981
|
MONTHLY_GUEST_CREDITS = 30;
|
|
25036
24982
|
}
|
|
25037
24983
|
});
|
|
@@ -27037,8 +26983,8 @@ function ChatProvider({
|
|
|
27037
26983
|
setSelectedAgent(a);
|
|
27038
26984
|
setDebateAgent(null);
|
|
27039
26985
|
}, [app, aiAgents]);
|
|
27040
|
-
const { isDevelopment:
|
|
27041
|
-
const hourlyLimit =
|
|
26986
|
+
const { isDevelopment: isDevelopment2, isE2E: isE2E3, actions } = useData();
|
|
26987
|
+
const hourlyLimit = isDevelopment2 && !isE2E3 ? 5e4 : getHourlyLimit({
|
|
27042
26988
|
member: user,
|
|
27043
26989
|
guest
|
|
27044
26990
|
});
|
|
@@ -28394,6 +28340,7 @@ var init_AppContext = __esm({
|
|
|
28394
28340
|
init_ThemeContext();
|
|
28395
28341
|
init_providers();
|
|
28396
28342
|
init_siteConfig();
|
|
28343
|
+
init_utils();
|
|
28397
28344
|
reportedMissingKeys = /* @__PURE__ */ new Set();
|
|
28398
28345
|
checkedKeys = /* @__PURE__ */ new Set();
|
|
28399
28346
|
AppContext = (0, import_react33.createContext)({
|
|
@@ -28406,12 +28353,10 @@ var init_AppContext = __esm({
|
|
|
28406
28353
|
}) => {
|
|
28407
28354
|
const { t: i18nT } = (0, import_react_i18next4.useTranslation)();
|
|
28408
28355
|
const { user, storeApps, atlas: atlas2 } = useAuth();
|
|
28409
|
-
const isE2E3 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
|
|
28410
|
-
const isCI2 = process.env.NEXT_PUBLIC_CI === "true";
|
|
28411
28356
|
const config2 = getSiteConfig();
|
|
28412
28357
|
const t5 = (key, values, autoAdd = true) => {
|
|
28413
28358
|
const result = i18nT(key, values);
|
|
28414
|
-
if (autoAdd && !
|
|
28359
|
+
if (autoAdd && !isCI && isE2E && user?.role === "admin" && typeof window !== "undefined" && !checkedKeys.has(key)) {
|
|
28415
28360
|
checkedKeys.add(key);
|
|
28416
28361
|
if (result === key && !reportedMissingKeys.has(key)) {
|
|
28417
28362
|
reportedMissingKeys.add(key);
|
|
@@ -31736,7 +31681,6 @@ function EnableNotifications({
|
|
|
31736
31681
|
const [isSubscribed, setIsSubscribed] = (0, import_react42.useState)(
|
|
31737
31682
|
void 0
|
|
31738
31683
|
);
|
|
31739
|
-
console.log(`\u{1F680} ~ isSubscribed:`, isSubscribed);
|
|
31740
31684
|
async function addPushSubscription(subscription, p256dh, auth) {
|
|
31741
31685
|
const response = await apiFetch(`${API_URL2}/pushSubscriptions`, {
|
|
31742
31686
|
method: "POST",
|
|
@@ -31818,10 +31762,6 @@ function EnableNotifications({
|
|
|
31818
31762
|
}
|
|
31819
31763
|
const registration = await registerServiceWorker_default2();
|
|
31820
31764
|
if (registration) {
|
|
31821
|
-
console.log(
|
|
31822
|
-
`\u{1F680} ~ initializeServiceWorker ~ registration:`,
|
|
31823
|
-
registration
|
|
31824
|
-
);
|
|
31825
31765
|
setSwRegistration(registration);
|
|
31826
31766
|
setIsSubscribed(false);
|
|
31827
31767
|
}
|
|
@@ -31851,7 +31791,7 @@ function EnableNotifications({
|
|
|
31851
31791
|
return;
|
|
31852
31792
|
}
|
|
31853
31793
|
if (swRegistration && !pushSubscription) {
|
|
31854
|
-
const publicVapidKey =
|
|
31794
|
+
const publicVapidKey = getEnv().NEXT_PUBLIC_VAPID_PUBLIC_KEY;
|
|
31855
31795
|
const subscription = await subscribeToPushNotifications(
|
|
31856
31796
|
swRegistration,
|
|
31857
31797
|
publicVapidKey
|
|
@@ -66797,14 +66737,13 @@ __export(index_exports, {
|
|
|
66797
66737
|
generateStoreMetadata: () => generateStoreMetadata,
|
|
66798
66738
|
generateThreadMetadata: () => generateThreadMetadata,
|
|
66799
66739
|
getActions: () => getActions,
|
|
66800
|
-
getApiEndpoint: () => getApiEndpoint,
|
|
66801
|
-
getApiUrl: () => getApiUrl,
|
|
66802
66740
|
getApp: () => getApp,
|
|
66803
66741
|
getApps: () => getApps,
|
|
66804
66742
|
getBrowserAPI: () => getBrowserAPI,
|
|
66805
66743
|
getBrowserIdentity: () => getBrowserIdentity,
|
|
66806
66744
|
getCalendarEvents: () => getCalendarEvents,
|
|
66807
66745
|
getDailyImageLimit: () => getDailyImageLimit,
|
|
66746
|
+
getEnv: () => getEnv,
|
|
66808
66747
|
getExampleInstructions: () => getExampleInstructions,
|
|
66809
66748
|
getExtensionUrl: () => getExtensionUrl,
|
|
66810
66749
|
getExtensionUrls: () => getExtensionUrls,
|
|
@@ -67037,14 +66976,13 @@ function HistoryRouterProvider({
|
|
|
67037
66976
|
generateStoreMetadata,
|
|
67038
66977
|
generateThreadMetadata,
|
|
67039
66978
|
getActions,
|
|
67040
|
-
getApiEndpoint,
|
|
67041
|
-
getApiUrl,
|
|
67042
66979
|
getApp,
|
|
67043
66980
|
getApps,
|
|
67044
66981
|
getBrowserAPI,
|
|
67045
66982
|
getBrowserIdentity,
|
|
67046
66983
|
getCalendarEvents,
|
|
67047
66984
|
getDailyImageLimit,
|
|
66985
|
+
getEnv,
|
|
67048
66986
|
getExampleInstructions,
|
|
67049
66987
|
getExtensionUrl,
|
|
67050
66988
|
getExtensionUrls,
|