@chrryai/chrry 1.1.84 → 1.1.86
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +105 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1278,7 +1278,7 @@ declare const isFirefox: boolean;
|
|
|
1278
1278
|
declare function getFlag({ code }: {
|
|
1279
1279
|
code?: string;
|
|
1280
1280
|
}): string;
|
|
1281
|
-
declare const VERSION = "1.1.
|
|
1281
|
+
declare const VERSION = "1.1.86";
|
|
1282
1282
|
type instructionBase = {
|
|
1283
1283
|
id: string;
|
|
1284
1284
|
title: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1278,7 +1278,7 @@ declare const isFirefox: boolean;
|
|
|
1278
1278
|
declare function getFlag({ code }: {
|
|
1279
1279
|
code?: string;
|
|
1280
1280
|
}): string;
|
|
1281
|
-
declare const VERSION = "1.1.
|
|
1281
|
+
declare const VERSION = "1.1.86";
|
|
1282
1282
|
type instructionBase = {
|
|
1283
1283
|
id: string;
|
|
1284
1284
|
title: string;
|
package/dist/index.js
CHANGED
|
@@ -729,7 +729,7 @@ var init_utils = __esm({
|
|
|
729
729
|
}
|
|
730
730
|
};
|
|
731
731
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
|
|
732
|
-
VERSION = "1.1.
|
|
732
|
+
VERSION = "1.1.86";
|
|
733
733
|
getInstructionConfig = ({
|
|
734
734
|
city,
|
|
735
735
|
country,
|
|
@@ -15056,7 +15056,7 @@ function AuthProvider({
|
|
|
15056
15056
|
if (!slugFromPath) return void 0;
|
|
15057
15057
|
return apps2.find((app2) => app2.slug === slugFromPath);
|
|
15058
15058
|
};
|
|
15059
|
-
const [
|
|
15059
|
+
const [store, setStore] = (0, import_react13.useState)(
|
|
15060
15060
|
session2?.app?.store
|
|
15061
15061
|
);
|
|
15062
15062
|
const {
|
|
@@ -15133,18 +15133,16 @@ function AuthProvider({
|
|
|
15133
15133
|
sessionData?.apps || []
|
|
15134
15134
|
);
|
|
15135
15135
|
const chrry = allApps?.find((app2) => !app2.store?.parentStoreId);
|
|
15136
|
-
const [appInternal, setAppInternal] = (0, import_react13.useState)(session2?.app);
|
|
15137
15136
|
const baseApp = allApps?.find(
|
|
15138
15137
|
(item) => item?.store?.domain === chrryUrl2 && item?.id === item?.store?.appId
|
|
15139
15138
|
);
|
|
15140
|
-
const app =
|
|
15141
|
-
const store = storeInternal;
|
|
15139
|
+
const [app, setAppInternal] = (0, import_react13.useState)(baseApp || session2?.app);
|
|
15142
15140
|
const [apps, setApps] = (0, import_react13.useState)(store?.apps || []);
|
|
15143
15141
|
(0, import_react13.useEffect)(() => {
|
|
15144
|
-
if (store?.apps) {
|
|
15145
|
-
setApps(store
|
|
15142
|
+
if (app?.store?.apps && app?.store?.apps.length) {
|
|
15143
|
+
setApps(app?.store?.apps);
|
|
15146
15144
|
}
|
|
15147
|
-
}, [
|
|
15145
|
+
}, [app]);
|
|
15148
15146
|
const storeApp = app?.store?.apps.find(
|
|
15149
15147
|
(item) => item.id === app?.store?.appId
|
|
15150
15148
|
);
|
|
@@ -15164,7 +15162,6 @@ function AuthProvider({
|
|
|
15164
15162
|
if (!baseApp || !allApps) return;
|
|
15165
15163
|
const matchedApp = findAppByPathname(pathname, allApps) || baseApp;
|
|
15166
15164
|
if (matchedApp) {
|
|
15167
|
-
console.log(`\u{1F680} ~ file: AuthProvider.tsx:880 ~ matchedApp:`, matchedApp);
|
|
15168
15165
|
setApp(matchedApp);
|
|
15169
15166
|
setStore(matchedApp.store);
|
|
15170
15167
|
let currentStoreApps = [];
|
|
@@ -15183,8 +15180,8 @@ function AuthProvider({
|
|
|
15183
15180
|
currentStoreAppsCount: currentStoreApps.length,
|
|
15184
15181
|
currentStoreAppsSlugs: currentStoreApps.map((a) => a.slug)
|
|
15185
15182
|
});
|
|
15186
|
-
const chrryApp = allApps?.find((a) => a.
|
|
15187
|
-
const hasChrry = currentStoreApps.some((a) => a.
|
|
15183
|
+
const chrryApp = allApps?.find((a) => a.id === chrry?.id);
|
|
15184
|
+
const hasChrry = currentStoreApps.some((a) => a.id === chrry?.id);
|
|
15188
15185
|
let finalApps = currentStoreApps;
|
|
15189
15186
|
if (!hasChrry && chrryApp && currentStoreApps.length > 0) {
|
|
15190
15187
|
finalApps = [
|
|
@@ -15513,6 +15510,7 @@ function getSiteConfig(m) {
|
|
|
15513
15510
|
mode: "chrryDev",
|
|
15514
15511
|
name: "Chrry",
|
|
15515
15512
|
domain: "chrry.dev",
|
|
15513
|
+
email: "iliyan@chrry.ai",
|
|
15516
15514
|
description: "A modern, cross-platform UI library for React, React Native, and Next.js",
|
|
15517
15515
|
logo: "/assets/cherry-logo.svg",
|
|
15518
15516
|
// Cross-platform SVG
|
|
@@ -15589,6 +15587,7 @@ function getSiteConfig(m) {
|
|
|
15589
15587
|
mode: "chrryAI",
|
|
15590
15588
|
name: "Chrry",
|
|
15591
15589
|
domain: "chrry.ai",
|
|
15590
|
+
email: "iliyan@chrry.ai",
|
|
15592
15591
|
description: "AI App Marketplace - Discover, create, and monetize AI apps",
|
|
15593
15592
|
logo: "\u{1F352}",
|
|
15594
15593
|
primaryColor: "#E91E63",
|
|
@@ -15662,6 +15661,7 @@ function getSiteConfig(m) {
|
|
|
15662
15661
|
mode: "vex",
|
|
15663
15662
|
name: "Vex",
|
|
15664
15663
|
domain: "askvex.com",
|
|
15664
|
+
email: "contact@askvex.com",
|
|
15665
15665
|
description: "AI assistant that helps you get things done",
|
|
15666
15666
|
logo: "\u{1F916}",
|
|
15667
15667
|
primaryColor: "#6366F1",
|
|
@@ -15753,7 +15753,7 @@ function DataProvider({
|
|
|
15753
15753
|
const [instructions, setInstructions] = (0, import_react15.useState)([]);
|
|
15754
15754
|
const [affiliateStats, setAffiliateStats] = (0, import_react15.useState)(null);
|
|
15755
15755
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react15.useState)(false);
|
|
15756
|
-
const VERSION3 = "1.1.
|
|
15756
|
+
const VERSION3 = "1.1.86";
|
|
15757
15757
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
15758
15758
|
const {
|
|
15759
15759
|
API_URL: API_URL2,
|
|
@@ -16342,8 +16342,8 @@ function AppProvider({
|
|
|
16342
16342
|
};
|
|
16343
16343
|
const isManagingApp = !!appStatus?.part;
|
|
16344
16344
|
(0, import_react18.useEffect)(() => {
|
|
16345
|
-
|
|
16346
|
-
}, [app?.themeColor]);
|
|
16345
|
+
app?.themeColor && setColorScheme(app?.themeColor || colorScheme);
|
|
16346
|
+
}, [app?.themeColor, colorScheme]);
|
|
16347
16347
|
(0, import_react18.useEffect)(() => {
|
|
16348
16348
|
app?.backgroundColor && setAppTheme(app?.backgroundColor);
|
|
16349
16349
|
}, [app?.backgroundColor]);
|
|
@@ -16677,7 +16677,8 @@ function AppProvider({
|
|
|
16677
16677
|
isRemovingApp,
|
|
16678
16678
|
owningApps,
|
|
16679
16679
|
stores,
|
|
16680
|
-
store
|
|
16680
|
+
store,
|
|
16681
|
+
baseApp
|
|
16681
16682
|
}
|
|
16682
16683
|
},
|
|
16683
16684
|
children
|
|
@@ -16756,7 +16757,7 @@ function ChatProvider({
|
|
|
16756
16757
|
const [isEmpty, setIsEmpty] = (0, import_react19.useState)(true);
|
|
16757
16758
|
const [thread2, setThread] = (0, import_react19.useState)(void 0);
|
|
16758
16759
|
const [messages, setMessages] = (0, import_react19.useState)([]);
|
|
16759
|
-
const { pathname } = useNavigation();
|
|
16760
|
+
const { pathname, addParams } = useNavigation();
|
|
16760
16761
|
const [threadId, setThreadId] = (0, import_react19.useState)(getThreadId(pathname));
|
|
16761
16762
|
(0, import_react19.useEffect)(() => {
|
|
16762
16763
|
setThreadId(getThreadId(pathname));
|
|
@@ -16871,6 +16872,42 @@ function ChatProvider({
|
|
|
16871
16872
|
setSelectedAgent(void 0);
|
|
16872
16873
|
}
|
|
16873
16874
|
}, [aiAgents, selectedAgent, user, guest]);
|
|
16875
|
+
const [isAgentModalOpen, setIsAgentModalOpenInternal] = (0, import_react19.useState)(false);
|
|
16876
|
+
const [isDebateAgentModalOpen, setIsDebateAgentModalOpenInternal] = (0, import_react19.useState)(false);
|
|
16877
|
+
const setIsAgentModalOpen = (open) => {
|
|
16878
|
+
setIsAgentModalOpenInternal(open);
|
|
16879
|
+
if (!open) {
|
|
16880
|
+
setIsDebateAgentModalOpenInternal(false);
|
|
16881
|
+
}
|
|
16882
|
+
open && track({
|
|
16883
|
+
name: "agent-modal",
|
|
16884
|
+
props: {}
|
|
16885
|
+
});
|
|
16886
|
+
};
|
|
16887
|
+
const setIsDebateAgentModalOpen = (open) => {
|
|
16888
|
+
setIsDebateAgentModalOpenInternal(open);
|
|
16889
|
+
setIsAgentModalOpenInternal(open);
|
|
16890
|
+
open && track({
|
|
16891
|
+
name: "debate-agent-modal",
|
|
16892
|
+
props: {}
|
|
16893
|
+
});
|
|
16894
|
+
};
|
|
16895
|
+
(0, import_react19.useEffect)(() => {
|
|
16896
|
+
if (app?.onlyAgent) {
|
|
16897
|
+
const a = aiAgents.find(
|
|
16898
|
+
(agent) => app?.defaultModel && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
|
|
16899
|
+
);
|
|
16900
|
+
if (!a) return;
|
|
16901
|
+
if (!isAgentAuthorized(a)) {
|
|
16902
|
+
addParams({
|
|
16903
|
+
subscribe: "true",
|
|
16904
|
+
plan: "member"
|
|
16905
|
+
});
|
|
16906
|
+
return;
|
|
16907
|
+
}
|
|
16908
|
+
setSelectedAgent(a);
|
|
16909
|
+
}
|
|
16910
|
+
}, [guest, user, app, aiAgents]);
|
|
16874
16911
|
const { isDevelopment: isDevelopment3, isE2E: isE2E2 } = useData();
|
|
16875
16912
|
const hourlyLimit = isDevelopment3 && !isE2E2 ? 5e4 : getHourlyLimit({
|
|
16876
16913
|
member: user,
|
|
@@ -16939,6 +16976,8 @@ function ChatProvider({
|
|
|
16939
16976
|
value: {
|
|
16940
16977
|
setIsWebSearchEnabled,
|
|
16941
16978
|
input,
|
|
16979
|
+
setIsAgentModalOpen,
|
|
16980
|
+
isAgentModalOpen,
|
|
16942
16981
|
creditsLeft,
|
|
16943
16982
|
aiAgents,
|
|
16944
16983
|
setInput,
|
|
@@ -16971,7 +17010,10 @@ function ChatProvider({
|
|
|
16971
17010
|
favouriteAgent,
|
|
16972
17011
|
messages,
|
|
16973
17012
|
setMessages,
|
|
16974
|
-
isAgentAuthorized
|
|
17013
|
+
isAgentAuthorized,
|
|
17014
|
+
setIsDebateAgentModalOpen,
|
|
17015
|
+
isDebateAgentModalOpen,
|
|
17016
|
+
setIsAgentModalOpenInternal
|
|
16975
17017
|
}
|
|
16976
17018
|
},
|
|
16977
17019
|
children
|
|
@@ -19413,7 +19455,8 @@ function ImageComponent(props) {
|
|
|
19413
19455
|
let finalSize = parseInt(size?.toString() || finalWidth.toString());
|
|
19414
19456
|
finalSize = finalSize;
|
|
19415
19457
|
if (app?.onlyAgent && !app.image) {
|
|
19416
|
-
|
|
19458
|
+
const color = COLORS[app?.themeColor] || "var(--accent-6)";
|
|
19459
|
+
return app.defaultModel === "deepSeek" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.DeepSeek, { color, size: finalSize }) : app.defaultModel === "chatGPT" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.OpenAI, { color, size: finalSize }) : app.defaultModel === "claude" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Claude, { color, size: finalSize }) : app.defaultModel === "gemini" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Gemini, { color, size: finalSize }) : app.defaultModel === "flux" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Flux, { color, size: finalSize }) : app.defaultModel === "perplexity" ? /* @__PURE__ */ import_react32.default.createElement(import_icons3.Perplexity, { color, size: finalSize }) : null;
|
|
19417
19460
|
}
|
|
19418
19461
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
19419
19462
|
Img,
|
|
@@ -19439,6 +19482,7 @@ var init_Image = __esm({
|
|
|
19439
19482
|
"use client";
|
|
19440
19483
|
import_react32 = __toESM(require("react"));
|
|
19441
19484
|
init_Img();
|
|
19485
|
+
init_AppContext();
|
|
19442
19486
|
init_platform();
|
|
19443
19487
|
init_providers();
|
|
19444
19488
|
import_icons3 = require("@lobehub/icons");
|
|
@@ -23736,7 +23780,22 @@ function Store({
|
|
|
23736
23780
|
color: "var(--accent-1)",
|
|
23737
23781
|
fill: "var(--accent-1)"
|
|
23738
23782
|
}
|
|
23739
|
-
), t5(feature))), /* @__PURE__ */ import_react66.default.createElement("li", { className: import_Store_module.default.feature }, /* @__PURE__ */ import_react66.default.createElement(
|
|
23783
|
+
), t5(feature))), /* @__PURE__ */ import_react66.default.createElement("li", { className: import_Store_module.default.feature }, /* @__PURE__ */ import_react66.default.createElement(
|
|
23784
|
+
A,
|
|
23785
|
+
{
|
|
23786
|
+
href: getAppSlug(selectedApp),
|
|
23787
|
+
onClick: (e) => {
|
|
23788
|
+
if (e.metaKey || e.ctrlKey) {
|
|
23789
|
+
return;
|
|
23790
|
+
}
|
|
23791
|
+
e.preventDefault();
|
|
23792
|
+
setIsNewChat(true, getAppSlug(selectedApp));
|
|
23793
|
+
},
|
|
23794
|
+
className: "link"
|
|
23795
|
+
},
|
|
23796
|
+
/* @__PURE__ */ import_react66.default.createElement(icons_exports.ArrowRight, { size: 16, color: "var(--accent-6)" }),
|
|
23797
|
+
t5("Try it now!")
|
|
23798
|
+
))))))),
|
|
23740
23799
|
!compact && /* @__PURE__ */ import_react66.default.createElement("div", { style: { display: "none" }, className: "seo-content" }, storeApps?.map((appItem) => /* @__PURE__ */ import_react66.default.createElement("section", { key: appItem.id }, /* @__PURE__ */ import_react66.default.createElement("h2", null, appItem.name), /* @__PURE__ */ import_react66.default.createElement("h3", null, t5(appItem.title || "")), /* @__PURE__ */ import_react66.default.createElement("p", null, t5(appItem.description || "")), Array.isArray(appItem.featureList) && appItem.featureList.length > 0 && /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, /* @__PURE__ */ import_react66.default.createElement("h4", null, t5("Key Features")), /* @__PURE__ */ import_react66.default.createElement("ul", null, appItem.featureList.map((feature, index) => /* @__PURE__ */ import_react66.default.createElement("li", { key: index }, t5(feature)))))))),
|
|
23741
23800
|
!compact && /* @__PURE__ */ import_react66.default.createElement("div", { className: import_Store_module.default.tetris }, /* @__PURE__ */ import_react66.default.createElement("div", { style: { display: "flex", gap: "1rem" } }, /* @__PURE__ */ import_react66.default.createElement(
|
|
23742
23801
|
"a",
|
|
@@ -29616,7 +29675,7 @@ function Agent({
|
|
|
29616
29675
|
const isChrry = app2.id === chrry?.id;
|
|
29617
29676
|
const isBaseApp = app2.id === baseApp?.id;
|
|
29618
29677
|
const checked = isBaseApp || isChrry || field.value?.includes(app2.name);
|
|
29619
|
-
const isDisabled =
|
|
29678
|
+
const isDisabled = isBaseApp || isChrry;
|
|
29620
29679
|
return /* @__PURE__ */ import_react43.default.createElement("label", { key: app2.id || app2.name }, /* @__PURE__ */ import_react43.default.createElement(
|
|
29621
29680
|
Checkbox_default,
|
|
29622
29681
|
{
|
|
@@ -30249,6 +30308,7 @@ function Instructions({
|
|
|
30249
30308
|
const [selectedInstruction, setSelectedInstructionInternal] = (0, import_react44.useState)(null);
|
|
30250
30309
|
const setSelectedInstruction = (instruction) => {
|
|
30251
30310
|
setSelectedInstructionInternal(instruction);
|
|
30311
|
+
instruction && setIsOpen(true);
|
|
30252
30312
|
};
|
|
30253
30313
|
const getMaxFileSize = (fileType) => {
|
|
30254
30314
|
const limits = MAX_FILE_SIZES;
|
|
@@ -31365,10 +31425,8 @@ function App({
|
|
|
31365
31425
|
app,
|
|
31366
31426
|
appForm,
|
|
31367
31427
|
appFormWatcher,
|
|
31368
|
-
clearFormDraft,
|
|
31369
31428
|
suggestSaveApp,
|
|
31370
31429
|
saveApp,
|
|
31371
|
-
isAppOwner,
|
|
31372
31430
|
canEditApp,
|
|
31373
31431
|
isManagingApp,
|
|
31374
31432
|
isSavingApp,
|
|
@@ -31378,19 +31436,10 @@ function App({
|
|
|
31378
31436
|
setApp,
|
|
31379
31437
|
appStatus,
|
|
31380
31438
|
setAppStatus,
|
|
31439
|
+
baseApp,
|
|
31381
31440
|
storeApp
|
|
31382
31441
|
} = useApp();
|
|
31383
|
-
const {
|
|
31384
|
-
user,
|
|
31385
|
-
guest,
|
|
31386
|
-
fetchSession,
|
|
31387
|
-
token,
|
|
31388
|
-
getAppSlug,
|
|
31389
|
-
baseApp,
|
|
31390
|
-
store,
|
|
31391
|
-
apps,
|
|
31392
|
-
chrry
|
|
31393
|
-
} = useAuth();
|
|
31442
|
+
const { user, guest, getAppSlug, store, apps, chrry } = useAuth();
|
|
31394
31443
|
const { FRONTEND_URL: FRONTEND_URL3 } = useData();
|
|
31395
31444
|
const { router, setIsNewChat } = useNavigationContext();
|
|
31396
31445
|
const { setInput, setIsWebSearchEnabled } = useChat();
|
|
@@ -31412,7 +31461,8 @@ function App({
|
|
|
31412
31461
|
const [appsState, setApps] = import_react49.default.useState(getApps());
|
|
31413
31462
|
(0, import_react49.useEffect)(() => {
|
|
31414
31463
|
setApps(getApps());
|
|
31415
|
-
}, [apps, store?.id, store?.appId, currentStoreId]);
|
|
31464
|
+
}, [apps, store?.id, store?.appId, currentStoreId, baseApp]);
|
|
31465
|
+
console.log(`\u{1F680} ~ file: App.tsx:129 ~ apps:`, apps);
|
|
31416
31466
|
const [file, setFile] = import_react49.default.useState();
|
|
31417
31467
|
const [image, setImageInternal] = import_react49.default.useState(
|
|
31418
31468
|
app?.image || void 0
|
|
@@ -32203,7 +32253,12 @@ function Chat({
|
|
|
32203
32253
|
hourlyLimit,
|
|
32204
32254
|
isEmpty: empty,
|
|
32205
32255
|
threadId,
|
|
32206
|
-
isAgentAuthorized
|
|
32256
|
+
isAgentAuthorized,
|
|
32257
|
+
isAgentModalOpen,
|
|
32258
|
+
setIsAgentModalOpen,
|
|
32259
|
+
isDebateAgentModalOpen,
|
|
32260
|
+
setIsDebateAgentModalOpen,
|
|
32261
|
+
setIsAgentModalOpenInternal
|
|
32207
32262
|
} = useChat();
|
|
32208
32263
|
const {
|
|
32209
32264
|
router,
|
|
@@ -32317,19 +32372,6 @@ function Chat({
|
|
|
32317
32372
|
}
|
|
32318
32373
|
return text2;
|
|
32319
32374
|
};
|
|
32320
|
-
(0, import_react50.useEffect)(() => {
|
|
32321
|
-
if (app?.defaultModel) {
|
|
32322
|
-
const a = aiAgents.find(
|
|
32323
|
-
(agent) => app?.defaultModel && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
|
|
32324
|
-
);
|
|
32325
|
-
if (!a) return;
|
|
32326
|
-
if (!isAgentAuthorized(a)) {
|
|
32327
|
-
setIsAgentModalOpen(true);
|
|
32328
|
-
return;
|
|
32329
|
-
}
|
|
32330
|
-
setSelectedAgent(a);
|
|
32331
|
-
}
|
|
32332
|
-
}, [guest, user, app, aiAgents]);
|
|
32333
32375
|
const animateSuggestions = () => {
|
|
32334
32376
|
const prefersReducedMotion = reduceMotion || typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
32335
32377
|
if (prefersReducedMotion) {
|
|
@@ -32372,27 +32414,7 @@ function Chat({
|
|
|
32372
32414
|
}
|
|
32373
32415
|
return cleanStreamedContent;
|
|
32374
32416
|
}
|
|
32375
|
-
const [isAgentModalOpen, setIsAgentModalOpenInternal] = (0, import_react50.useState)(false);
|
|
32376
32417
|
const [attempt, setAttempt] = (0, import_react50.useState)(void 0);
|
|
32377
|
-
const setIsAgentModalOpen = (open) => {
|
|
32378
|
-
setIsAgentModalOpenInternal(open);
|
|
32379
|
-
if (!open) {
|
|
32380
|
-
setIsDebateAgentModalOpenInternal(false);
|
|
32381
|
-
}
|
|
32382
|
-
open && track({
|
|
32383
|
-
name: "agent-modal",
|
|
32384
|
-
props: {}
|
|
32385
|
-
});
|
|
32386
|
-
};
|
|
32387
|
-
const [isDebateAgentModalOpen, setIsDebateAgentModalOpenInternal] = (0, import_react50.useState)(false);
|
|
32388
|
-
const setIsDebateAgentModalOpen = (open) => {
|
|
32389
|
-
setIsDebateAgentModalOpenInternal(open);
|
|
32390
|
-
setIsAgentModalOpenInternal(open);
|
|
32391
|
-
open && track({
|
|
32392
|
-
name: "debate-agent-modal",
|
|
32393
|
-
props: {}
|
|
32394
|
-
});
|
|
32395
|
-
};
|
|
32396
32418
|
const [isLoading, setIsLoading] = (0, import_react50.useState)(false);
|
|
32397
32419
|
const [isStreaming, setIsStreaming] = (0, import_react50.useState)(false);
|
|
32398
32420
|
const controller = new AbortController();
|
|
@@ -33495,7 +33517,10 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
33495
33517
|
}
|
|
33496
33518
|
if (result?.contextMenuAction?.text) {
|
|
33497
33519
|
setInput(`${message2}: ${result.contextMenuAction.text}`);
|
|
33498
|
-
|
|
33520
|
+
const storageLocal = BrowserInstance?.storage?.local;
|
|
33521
|
+
if (storageLocal && "remove" in storageLocal) {
|
|
33522
|
+
await storageLocal.remove(["contextMenuAction"]);
|
|
33523
|
+
}
|
|
33499
33524
|
if (type !== "aiDebate") {
|
|
33500
33525
|
debateAgent && setDebateAgent(null);
|
|
33501
33526
|
setAttempt("submit");
|
|
@@ -33527,10 +33552,16 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
33527
33552
|
};
|
|
33528
33553
|
processAction();
|
|
33529
33554
|
const interval = setInterval(processAction, 2e3);
|
|
33530
|
-
BrowserInstance?.storage
|
|
33555
|
+
const storageAPI = BrowserInstance?.storage;
|
|
33556
|
+
const hasOnChanged = storageAPI && "onChanged" in storageAPI && storageAPI.onChanged;
|
|
33557
|
+
if (hasOnChanged) {
|
|
33558
|
+
storageAPI.onChanged.addListener(handleStorageChange);
|
|
33559
|
+
}
|
|
33531
33560
|
return () => {
|
|
33532
33561
|
clearInterval(interval);
|
|
33533
|
-
|
|
33562
|
+
if (hasOnChanged) {
|
|
33563
|
+
storageAPI.onChanged.removeListener(handleStorageChange);
|
|
33564
|
+
}
|
|
33534
33565
|
};
|
|
33535
33566
|
}, [setInput]);
|
|
33536
33567
|
const [streamId, setStreamId] = (0, import_react50.useState)(null);
|
|
@@ -34061,7 +34092,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
34061
34092
|
if (agent.authorization === "user" && !user && !guest?.subscription) {
|
|
34062
34093
|
const url = threadId ? `/threads/${threadId}?subscribe=true&plan=member` : "/?subscribe=true&plan=member";
|
|
34063
34094
|
if (checkIsExtension()) {
|
|
34064
|
-
BrowserInstance?.runtime?.sendMessage({
|
|
34095
|
+
BrowserInstance?.runtime?.sendMessage?.({
|
|
34065
34096
|
action: "openInSameTab",
|
|
34066
34097
|
url: `${FRONTEND_URL3}${url}`
|
|
34067
34098
|
});
|
|
@@ -34147,7 +34178,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
34147
34178
|
addHapticFeedback();
|
|
34148
34179
|
const url = threadId ? `/threads/${threadId}?subscribe=true&plan=member` : "/?subscribe=true&plan=member";
|
|
34149
34180
|
if (checkIsExtension()) {
|
|
34150
|
-
BrowserInstance?.runtime?.sendMessage({
|
|
34181
|
+
BrowserInstance?.runtime?.sendMessage?.({
|
|
34151
34182
|
action: "openInSameTab",
|
|
34152
34183
|
url: `${FRONTEND_URL3}${url}`
|
|
34153
34184
|
});
|
|
@@ -34615,6 +34646,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
34615
34646
|
/* @__PURE__ */ React.createElement(
|
|
34616
34647
|
"button",
|
|
34617
34648
|
{
|
|
34649
|
+
disabled: isChrry || !!app?.onlyAgent,
|
|
34618
34650
|
"data-testid": !debateAgent ? selectedAgent?.name !== "flux" ? "add-debate-agent-button" : void 0 : "agent-select-button",
|
|
34619
34651
|
"data-agent-name": selectedAgent.name,
|
|
34620
34652
|
title: t5("Add debate agent"),
|