@chrryai/chrry 1.6.62 → 1.6.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2446,7 +2446,6 @@ function generateAppMetadata({
|
|
|
2446
2446
|
translations,
|
|
2447
2447
|
...rest
|
|
2448
2448
|
}) {
|
|
2449
|
-
console.log(`\u{1F680} ~ appssss:`, app.name);
|
|
2450
2449
|
const title = app.name || app.title || "Chrry";
|
|
2451
2450
|
const description = app.description || `${title} - Blossom`;
|
|
2452
2451
|
const whiteLabel = rest.whiteLabel || app.store?.apps.find((app2) => app2.id === app2.store?.app?.id);
|
|
@@ -3130,7 +3129,7 @@ var init_utils = __esm({
|
|
|
3130
3129
|
};
|
|
3131
3130
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
|
|
3132
3131
|
config = getSiteConfig(getClientHostname());
|
|
3133
|
-
VERSION = config.version || "1.6.
|
|
3132
|
+
VERSION = config.version || "1.6.63";
|
|
3134
3133
|
getSlugFromPathname = (path) => {
|
|
3135
3134
|
return getAppAndStoreSlugs(path, {
|
|
3136
3135
|
defaultAppSlug: config.slug,
|
|
@@ -23893,8 +23892,6 @@ function AuthProvider({
|
|
|
23893
23892
|
const id = getThreadId(pathname);
|
|
23894
23893
|
if (id) {
|
|
23895
23894
|
setThreadId(id);
|
|
23896
|
-
} else {
|
|
23897
|
-
setThreadId(void 0);
|
|
23898
23895
|
}
|
|
23899
23896
|
}, [pathname]);
|
|
23900
23897
|
const [app, setAppInternal] = (0, import_react20.useState)(props.app || session2?.app || baseApp);
|
|
@@ -24661,7 +24658,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24661
24658
|
const [instructions, setInstructions] = (0, import_react21.useState)([]);
|
|
24662
24659
|
const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
|
|
24663
24660
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
|
|
24664
|
-
const VERSION4 = "1.6.
|
|
24661
|
+
const VERSION4 = "1.6.63";
|
|
24665
24662
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24666
24663
|
const {
|
|
24667
24664
|
API_URL: API_URL2,
|
|
@@ -37378,6 +37375,7 @@ function Chat({
|
|
|
37378
37375
|
setShouldFocus,
|
|
37379
37376
|
shouldFocus,
|
|
37380
37377
|
isChatFloating: isChatFloatingContext,
|
|
37378
|
+
setThreadId: setThreadIdInternal,
|
|
37381
37379
|
messages
|
|
37382
37380
|
} = useChat();
|
|
37383
37381
|
const {
|
|
@@ -37392,7 +37390,7 @@ function Chat({
|
|
|
37392
37390
|
const { slug, suggestSaveApp, saveApp, apps, appStatus, appFormWatcher } = useApp();
|
|
37393
37391
|
const threadIdRef = (0, import_react55.useRef)(threadId);
|
|
37394
37392
|
(0, import_react55.useEffect)(() => {
|
|
37395
|
-
threadIdRef.current = threadId;
|
|
37393
|
+
threadId && (threadIdRef.current = threadId);
|
|
37396
37394
|
}, [threadId]);
|
|
37397
37395
|
const setThreadId = (id) => {
|
|
37398
37396
|
threadIdRef.current = id;
|
|
@@ -37598,6 +37596,7 @@ function Chat({
|
|
|
37598
37596
|
const setMessage = (message3) => {
|
|
37599
37597
|
setMessageInternal(message3);
|
|
37600
37598
|
setClientId(message3?.message?.clientId);
|
|
37599
|
+
message3?.message?.threadId && setThreadId(message3?.message?.threadId);
|
|
37601
37600
|
};
|
|
37602
37601
|
const isHydrated = useHasHydrated();
|
|
37603
37602
|
const [isAttaching, setIsAttachingInternal] = (0, import_react55.useState)(false);
|
|
@@ -38344,6 +38343,7 @@ function Chat({
|
|
|
38344
38343
|
}
|
|
38345
38344
|
});
|
|
38346
38345
|
setIsLoading(true);
|
|
38346
|
+
const sanitizedThreadId = threadIdRef.current && (0, import_uuid3.validate)(threadIdRef.current) ? threadIdRef.current : null;
|
|
38347
38347
|
try {
|
|
38348
38348
|
let postRequestBody;
|
|
38349
38349
|
let postRequestHeaders = {
|
|
@@ -38358,7 +38358,7 @@ function Chat({
|
|
|
38358
38358
|
formData.append("isIncognito", JSON.stringify(isIncognito));
|
|
38359
38359
|
selectedAgent && formData.append("agentId", selectedAgent?.id);
|
|
38360
38360
|
debateAgent && formData.append("debateAgentId", debateAgent?.id);
|
|
38361
|
-
|
|
38361
|
+
sanitizedThreadId && formData.append("threadId", sanitizedThreadId);
|
|
38362
38362
|
formData.append("attachmentType", "file");
|
|
38363
38363
|
formData.append("webSearchEnabled", JSON.stringify(isWebSearchEnabled));
|
|
38364
38364
|
formData.append(
|
|
@@ -38382,7 +38382,7 @@ function Chat({
|
|
|
38382
38382
|
isIncognito,
|
|
38383
38383
|
agentId: selectedAgent?.id,
|
|
38384
38384
|
debateAgentId: debateAgent?.id,
|
|
38385
|
-
threadId:
|
|
38385
|
+
threadId: sanitizedThreadId,
|
|
38386
38386
|
webSearchEnabled: isWebSearchEnabled && !isExtension2,
|
|
38387
38387
|
imageGenerationEnabled: isImageGenerationEnabled,
|
|
38388
38388
|
actionEnabled: isExtension2,
|
|
@@ -43816,7 +43816,12 @@ function Subscribe({
|
|
|
43816
43816
|
try {
|
|
43817
43817
|
setIsAdding(true);
|
|
43818
43818
|
const result = await apiFetch(
|
|
43819
|
-
`${API_URL2}/users?search=${encodeURIComponent(search)}
|
|
43819
|
+
`${API_URL2}/users?search=${encodeURIComponent(search)}`,
|
|
43820
|
+
{
|
|
43821
|
+
headers: {
|
|
43822
|
+
Authorization: `Bearer ${token}`
|
|
43823
|
+
}
|
|
43824
|
+
}
|
|
43820
43825
|
);
|
|
43821
43826
|
if (!result.ok) {
|
|
43822
43827
|
setIsAdding(false);
|
|
@@ -50485,7 +50490,7 @@ var init_Thread = __esm({
|
|
|
50485
50490
|
isIncognito,
|
|
50486
50491
|
goToCalendar
|
|
50487
50492
|
} = useNavigationContext();
|
|
50488
|
-
const { threadId,
|
|
50493
|
+
const { threadId, setShouldGetCredits } = useChat();
|
|
50489
50494
|
const setMessages = setMessagesInternal;
|
|
50490
50495
|
const { appStatus, appFormWatcher, suggestSaveApp } = useApp();
|
|
50491
50496
|
const { addHapticFeedback, isMobileDevice, isSmallDevice } = useTheme2();
|
|
@@ -51017,7 +51022,6 @@ var init_Thread = __esm({
|
|
|
51017
51022
|
const navigationOptions = {
|
|
51018
51023
|
state: { preservedThread: thread2 }
|
|
51019
51024
|
};
|
|
51020
|
-
setIsNewChat(false);
|
|
51021
51025
|
if (typeof window !== "undefined") {
|
|
51022
51026
|
window.history.pushState(
|
|
51023
51027
|
navigationOptions.state,
|