@chrryai/chrry 1.1.80 → 1.1.83

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/README.md CHANGED
@@ -96,10 +96,6 @@ import { locale } from "@chrryai/chrry/locales"
96
96
 
97
97
  We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
98
98
 
99
- ## 📄 License
100
-
101
- MIT © [AskVex](https://askvex.com)
102
-
103
99
  ## 🔗 Links
104
100
 
105
101
  - [Website](https://chrry.dev)
package/dist/index.d.mts CHANGED
@@ -418,6 +418,7 @@ type characterProfile = {
418
418
  };
419
419
  type app = {
420
420
  id: string;
421
+ image?: string;
421
422
  userId: string | null;
422
423
  guestId: string | null;
423
424
  mainThreadId: string | null;
@@ -1275,7 +1276,7 @@ declare const isFirefox: boolean;
1275
1276
  declare function getFlag({ code }: {
1276
1277
  code?: string;
1277
1278
  }): string;
1278
- declare const VERSION = "1.1.80";
1279
+ declare const VERSION = "1.1.83";
1279
1280
  type instructionBase = {
1280
1281
  id: string;
1281
1282
  title: string;
package/dist/index.d.ts CHANGED
@@ -418,6 +418,7 @@ type characterProfile = {
418
418
  };
419
419
  type app = {
420
420
  id: string;
421
+ image?: string;
421
422
  userId: string | null;
422
423
  guestId: string | null;
423
424
  mainThreadId: string | null;
@@ -1275,7 +1276,7 @@ declare const isFirefox: boolean;
1275
1276
  declare function getFlag({ code }: {
1276
1277
  code?: string;
1277
1278
  }): string;
1278
- declare const VERSION = "1.1.80";
1279
+ declare const VERSION = "1.1.83";
1279
1280
  type instructionBase = {
1280
1281
  id: string;
1281
1282
  title: string;
package/dist/index.js CHANGED
@@ -701,7 +701,7 @@ var init_utils = __esm({
701
701
  };
702
702
  FE_PORT = process.env.NEXT_PUBLIC_FE_PORT || "3000";
703
703
  API_PORT = process.env.API_PORT || "3001";
704
- API_URL = isTestingDevice ? `http://192.168.2.27:${API_PORT}/api` : isDevelopment ? `http://localhost:${API_PORT}/api` : "https://askvex.com/api";
704
+ API_URL = process.env.NEXT_PUBLIC_API_URL || isTestingDevice ? `http://192.168.2.27:${API_PORT}/api` : isDevelopment ? `http://localhost:${API_PORT}/api` : "https://askvex.com/api";
705
705
  PROD_FRONTEND_URL = "https://askvex.com";
706
706
  FRONTEND_URL = isTestingDevice ? `http://192.168.2.27:${FE_PORT}` : isDevelopment ? `http://localhost:${FE_PORT}` : PROD_FRONTEND_URL;
707
707
  PROMPT_LIMITS = {
@@ -830,7 +830,7 @@ var init_utils = __esm({
830
830
  }
831
831
  };
832
832
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
833
- VERSION = "1.1.80";
833
+ VERSION = "1.1.83";
834
834
  getInstructionConfig = ({
835
835
  city,
836
836
  country,
@@ -21910,9 +21910,9 @@ function AuthProvider({
21910
21910
  const API_PORT2 = process.env.API_PORT || "3001";
21911
21911
  const isTestingDevice2 = false;
21912
21912
  const PROD_FRONTEND_URL2 = "https://askvex.com";
21913
- const WS_URL2 = isTestingDevice2 ? "ws://192.168.2.27:5001" : env === "development" ? "ws://localhost:5001" : env === "staging" ? "wss://staging-ws.askvex.com" : "wss://ws.askvex.com";
21914
- const API_URL2 = isTestingDevice2 ? `http://192.168.2.27:${API_PORT2}/api` : env === "development" ? `http://localhost:${API_PORT2}/api` : env === "staging" ? "https://staging.askvex.com/api" : "https://askvex.com/api";
21915
- const FRONTEND_URL3 = isTestingDevice2 ? `http://192.168.2.27:${FE_PORT2}` : env === "development" ? `http://localhost:${FE_PORT2}` : env === "staging" ? "https://staging.askvex.com" : "https://askvex.com";
21913
+ const WS_URL2 = process.env.NEXT_PUBLIC_WS_URL || (isTestingDevice2 ? "ws://192.168.2.27:5001" : env === "development" ? "ws://localhost:5001" : env === "staging" ? "wss://staging-ws.askvex.com" : "wss://ws.askvex.com");
21914
+ const API_URL2 = process.env.NEXT_PUBLIC_API_URL || (isTestingDevice2 ? `http://192.168.2.27:${API_PORT2}/api` : env === "development" ? `http://localhost:${API_PORT2}/api` : env === "staging" ? "https://staging.askvex.com/api" : "https://askvex.com/api");
21915
+ const FRONTEND_URL3 = process.env.NEXT_PUBLIC_FRONTEND_URL || (isTestingDevice2 ? `http://192.168.2.27:${FE_PORT2}` : env === "development" ? `http://localhost:${FE_PORT2}` : env === "staging" ? "https://staging.askvex.com" : "https://askvex.com");
21916
21916
  const initialDeviceId = (0, import_react16.useRef)(v4_default());
21917
21917
  const [deviceIdFromStorage, setDeviceIdToStorage] = useLocalStorage2(
21918
21918
  "deviceId",
@@ -22695,7 +22695,7 @@ function DataProvider({
22695
22695
  const [instructions, setInstructions] = (0, import_react18.useState)([]);
22696
22696
  const [affiliateStats, setAffiliateStats] = (0, import_react18.useState)(null);
22697
22697
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react18.useState)(false);
22698
- const VERSION3 = "1.1.80";
22698
+ const VERSION3 = "1.1.83";
22699
22699
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
22700
22700
  const {
22701
22701
  API_URL: API_URL2,
@@ -23902,7 +23902,7 @@ function ChatProvider({
23902
23902
  children,
23903
23903
  ...props
23904
23904
  }) {
23905
- const { setGuest, setUser, ...auth } = useAuth();
23905
+ const { setGuest, setUser, app, chrry, ...auth } = useAuth();
23906
23906
  const [session2, setSession] = (0, import_react22.useState)(props.session);
23907
23907
  (0, import_react22.useEffect)(() => {
23908
23908
  auth.session && setSession(auth.session);
@@ -24082,6 +24082,15 @@ function ChatProvider({
24082
24082
  );
24083
24083
  }
24084
24084
  }, [hitHourlyLimit]);
24085
+ (0, import_react22.useEffect)(() => {
24086
+ if (chrry?.id === app?.id) {
24087
+ if (user) {
24088
+ setSelectedAgent(claudeAgent);
24089
+ } else if (guest) {
24090
+ setSelectedAgent(deepSeekAgent);
24091
+ }
24092
+ }
24093
+ }, [chrry, user, guest]);
24085
24094
  return /* @__PURE__ */ import_react22.default.createElement(
24086
24095
  ChatContext.Provider,
24087
24096
  {
@@ -24119,7 +24128,8 @@ function ChatProvider({
24119
24128
  claudeAgent,
24120
24129
  favouriteAgent,
24121
24130
  messages,
24122
- setMessages
24131
+ setMessages,
24132
+ isAgentAuthorized
24123
24133
  }
24124
24134
  },
24125
24135
  children
@@ -33298,7 +33308,7 @@ function About2() {
33298
33308
  href: isStandalone2 ? void 0 : `${FRONTEND_URL3}/privacy`
33299
33309
  },
33300
33310
  t5("Privacy Policy")
33301
- ), ", ", /* @__PURE__ */ import_react85.default.createElement("a", { href: "https://x.com/askvexai" }, "@askvexAI"), ", ", /* @__PURE__ */ import_react85.default.createElement("a", { href: "mailto:contact@askvex.com" }, "contact@askvex.com"))),
33311
+ ), ", ", /* @__PURE__ */ import_react85.default.createElement("a", { href: "https://x.com/askvexai" }, "@askvexAI"), ", ", /* @__PURE__ */ import_react85.default.createElement("a", { href: "mailto:iliyan@chrry.ai" }, "iliyan@chrry.ai"))),
33302
33312
  /* @__PURE__ */ import_react85.default.createElement("section", null, /* @__PURE__ */ import_react85.default.createElement("p", null, "\u{1F970} ", t5("about.intro")), /* @__PURE__ */ import_react85.default.createElement("p", { style: { marginTop: "1rem" } }, t5("about.intro2"))),
33303
33313
  apps && apps.length > 0 && /* @__PURE__ */ import_react85.default.createElement("section", null, /* @__PURE__ */ import_react85.default.createElement("h2", null, config.logo, " ", t5("Available Apps")), /* @__PURE__ */ import_react85.default.createElement("p", null, t5("Discover AI-powered apps from our store")), /* @__PURE__ */ import_react85.default.createElement("div", { className: import_About_module3.default.apps }, apps.map((app) => /* @__PURE__ */ import_react85.default.createElement(
33304
33314
  "div",
@@ -34312,7 +34322,7 @@ function Chrry() {
34312
34322
  const config = getSiteConfig("chrryDev");
34313
34323
  const isChrry = config.mode === "chrryDev";
34314
34324
  const { FRONTEND_URL: FRONTEND_URL3, PROD_FRONTEND_URL: PROD_FRONTEND_URL2, isDevelopment: isDevelopment3 } = useData();
34315
- return /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.container }, /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.header }, /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.vex }, /* @__PURE__ */ import_react90.default.createElement("span", null, "Built by "), /* @__PURE__ */ import_react90.default.createElement(Anchor, { href: "https://askvex.com" }, /* @__PURE__ */ import_react90.default.createElement(ImageComponent, { logo: "isVivid", size: 24 }), "Vex"), /* @__PURE__ */ import_react90.default.createElement("p", null, /* @__PURE__ */ import_react90.default.createElement("code", null, "npm install @chrryai/chrry"))), /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.logo }, /* @__PURE__ */ import_react90.default.createElement(ImageComponent, { logo: "chrry", size: 250 }), /* @__PURE__ */ import_react90.default.createElement("h1", null, "Chrry")), /* @__PURE__ */ import_react90.default.createElement("p", { className: import_Chrry_module.default.description }, config.description), isChrry && config.links && /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.links }, config.links.github && /* @__PURE__ */ import_react90.default.createElement(
34325
+ return /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.container }, /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.header }, /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.vex }, /* @__PURE__ */ import_react90.default.createElement("span", null, "Built by "), /* @__PURE__ */ import_react90.default.createElement(Anchor, { href: "https://askvex.com", openInNewTab: true }, /* @__PURE__ */ import_react90.default.createElement(ImageComponent, { src: "https://askvex.com/icons/icon-128-v.png", size: 24 }), "Vex"), /* @__PURE__ */ import_react90.default.createElement("p", null, /* @__PURE__ */ import_react90.default.createElement("code", null, "npm install @chrryai/chrry"))), /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.logo }, /* @__PURE__ */ import_react90.default.createElement(ImageComponent, { src: "https://askvex.com/logo/cherry-500.png", size: 250 }), /* @__PURE__ */ import_react90.default.createElement("h1", null, "Chrry")), /* @__PURE__ */ import_react90.default.createElement("p", { className: import_Chrry_module.default.description }, config.description), isChrry && config.links && /* @__PURE__ */ import_react90.default.createElement("div", { className: import_Chrry_module.default.links }, config.links.github && /* @__PURE__ */ import_react90.default.createElement(
34316
34326
  "a",
34317
34327
  {
34318
34328
  href: config.links.github,
@@ -39333,7 +39343,8 @@ function Chat({
39333
39343
  hitHourlyLimit,
39334
39344
  hourlyLimit,
39335
39345
  isEmpty: empty,
39336
- threadId
39346
+ threadId,
39347
+ isAgentAuthorized
39337
39348
  } = useChat();
39338
39349
  const {
39339
39350
  router,
@@ -39447,6 +39458,19 @@ function Chat({
39447
39458
  }
39448
39459
  return text2;
39449
39460
  };
39461
+ (0, import_react53.useEffect)(() => {
39462
+ if (app?.defaultModel) {
39463
+ const a = aiAgents.find(
39464
+ (agent) => app?.defaultModel && agent.name.toLowerCase() === app?.defaultModel?.toLowerCase()
39465
+ );
39466
+ if (!a) return;
39467
+ if (!isAgentAuthorized(a)) {
39468
+ setIsAgentModalOpen(true);
39469
+ return;
39470
+ }
39471
+ setSelectedAgent(a);
39472
+ }
39473
+ }, [guest, user, app, aiAgents]);
39450
39474
  const animateSuggestions = () => {
39451
39475
  const prefersReducedMotion2 = reduceMotion || typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
39452
39476
  if (prefersReducedMotion2) {
@@ -41748,7 +41772,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
41748
41772
  className: (0, import_clsx13.default)("link", import_Chat_module.default.debateAgentButton)
41749
41773
  },
41750
41774
  isChrry ? /* @__PURE__ */ React.createElement(ImageComponent, { app: chrry, size: 20 }) : selectedAgent.name === "deepSeek" ? /* @__PURE__ */ React.createElement(import_icons15.DeepSeek, { color: "var(--accent-6)", size: 24 }) : selectedAgent.name === "chatGPT" ? /* @__PURE__ */ React.createElement(import_icons15.OpenAI, { color: "var(--accent-6)", size: 22 }) : selectedAgent.name === "claude" ? /* @__PURE__ */ React.createElement(import_icons15.Claude, { color: "var(--accent-6)", size: 22 }) : selectedAgent.name === "gemini" ? /* @__PURE__ */ React.createElement(import_icons15.Gemini, { color: "var(--accent-6)", size: 22 }) : selectedAgent.name === "flux" ? /* @__PURE__ */ React.createElement(import_icons15.Flux, { color: "var(--accent-6)", size: 22 }) : selectedAgent.name === "perplexity" ? /* @__PURE__ */ React.createElement(import_icons15.Perplexity, { color: "var(--accent-6)", size: 22 }) : null,
41751
- isChrry || selectedAgent?.name === "flux" || debateAgent ? null : /* @__PURE__ */ React.createElement(
41775
+ isChrry || app?.onlyAgent || selectedAgent?.name === "flux" || debateAgent ? null : /* @__PURE__ */ React.createElement(
41752
41776
  icons_exports.Plus,
41753
41777
  {
41754
41778
  strokeWidth: 3,
@@ -41758,7 +41782,7 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
41758
41782
  }
41759
41783
  )
41760
41784
  ),
41761
- debateAgent && !isChrry ? /* @__PURE__ */ React.createElement(
41785
+ debateAgent && !isChrry && !app?.onlyAgent ? /* @__PURE__ */ React.createElement(
41762
41786
  "button",
41763
41787
  {
41764
41788
  "data-testid": "add-debate-agent-button",
@@ -41778,12 +41802,12 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
41778
41802
  ) : /* @__PURE__ */ React.createElement(
41779
41803
  "button",
41780
41804
  {
41781
- disabled: isChrry,
41805
+ disabled: isChrry || !!app?.onlyAgent,
41782
41806
  translate: "no",
41783
41807
  "data-agent-name": selectedAgent.name,
41784
41808
  "data-testid": "agent-select-button",
41785
41809
  style: {
41786
- color: isChrry ? "var(--shade-6)" : void 0
41810
+ color: isChrry || app?.onlyAgent ? "var(--shade-6)" : void 0
41787
41811
  },
41788
41812
  onClick: () => {
41789
41813
  if (appStatus?.part) {
@@ -41797,10 +41821,10 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
41797
41821
  type: "submit"
41798
41822
  },
41799
41823
  /* @__PURE__ */ React.createElement("span", { className: import_Chat_module.default.agentName }, isChrry ? `Chrry ${VERSION3.substring(0, 3)}` : selectedAgent?.displayName),
41800
- !isChrry && /* @__PURE__ */ React.createElement(icons_exports.ChevronDown, { color: "var(--accent-6)", size: 20 })
41824
+ !isChrry && !app?.onlyAgent && /* @__PURE__ */ React.createElement(icons_exports.ChevronDown, { color: "var(--accent-6)", size: 20 })
41801
41825
  )
41802
41826
  ),
41803
- !appStatus?.part && !isChrry && /* @__PURE__ */ React.createElement(
41827
+ !appStatus?.part && !isChrry && !app?.onlyAgent && /* @__PURE__ */ React.createElement(
41804
41828
  "button",
41805
41829
  {
41806
41830
  "data-testid": debateAgent ? "debate-agent-delete-button" : "agent-delete-button",
@@ -44347,7 +44371,7 @@ var Hey = (0, import_react93.memo)(
44347
44371
  }) {
44348
44372
  const { isHome, userNameByUrl, pathname, isSplash, setIsSplash } = useNavigationContext();
44349
44373
  const { threadId } = useChat();
44350
- const { app, slug, allApps } = useAuth();
44374
+ const { slug, allApps, chrry, ...auth } = useAuth();
44351
44375
  const { isDevelopment: isDevelopment3 } = useData();
44352
44376
  (0, import_react93.useEffect)(() => {
44353
44377
  useExtensionIcon?.(slug);
@@ -44372,10 +44396,11 @@ var Hey = (0, import_react93.memo)(
44372
44396
  const handleImageLoad = (0, import_react93.useCallback)(() => {
44373
44397
  setIsImageLoaded(true);
44374
44398
  }, []);
44375
- const memoizedApp = (0, import_react93.useMemo)(() => app, [app?.id, app?.slug, app?.image]);
44376
44399
  const config = getSiteConfig();
44400
+ const app = config.mode === "chrryDev" ? chrry : auth.app;
44401
+ const memoizedApp = (0, import_react93.useMemo)(() => app, [app?.id, app?.slug, app?.image]);
44377
44402
  const splash = (0, import_react93.useMemo)(
44378
- () => /* @__PURE__ */ React.createElement("div", { className: (0, import_clsx46.default)(import_Sidebar_module.default.splash, !isSplash && import_Sidebar_module.default.hidden) }, /* @__PURE__ */ React.createElement(
44403
+ () => memoizedApp && /* @__PURE__ */ React.createElement("div", { className: (0, import_clsx46.default)(import_Sidebar_module.default.splash, !isSplash && import_Sidebar_module.default.hidden) }, /* @__PURE__ */ React.createElement(
44379
44404
  ImageComponent,
44380
44405
  {
44381
44406
  onLoad: handleImageLoad,