@chrryai/chrry 1.1.89 → 1.1.95

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
@@ -1,18 +1,29 @@
1
1
  # 🍒 Chrry
2
2
 
3
- **A modern, cross-platform UI library for React, React Native, and Next.js**
3
+ **Production-ready React component library for building AI applications**
4
4
 
5
- Built by the team behind [Vex](https://askvex.com) - the AI assistant that helps you get things done.
5
+ [![npm](https://img.shields.io/npm/v/@chrryai/chrry)](https://www.npmjs.com/package/@chrryai/chrry)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue)](https://www.typescriptlang.org/)
7
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
8
 
7
- ## Features
9
+ > Extracted from [Vex](https://askvex.com) - A production AI platform with 6,813+ commits in 2025
8
10
 
9
- - 🎨 **Beautiful Components** - Modern, accessible UI components
10
- - 📱 **Cross-Platform** - Works on Web, iOS, Android, and Browser Extensions
11
- - 🎯 **TypeScript First** - Full type safety out of the box
11
+ ---
12
+
13
+ ## What is Chrry?
14
+
15
+ Chrry is a comprehensive React component library built for AI applications. It includes everything you need to build ChatGPT-like interfaces, multi-tenant app stores, and real-time collaboration features.
16
+
17
+ **Key Features:**
18
+
19
+ - 🎨 **50+ Components** - Chat, modals, forms, layouts, and more
20
+ - 🤖 **AI-First** - Built specifically for AI chat interfaces
21
+ - 📱 **Cross-Platform** - Web, iOS, Android, Browser Extensions
22
+ - 🎯 **TypeScript** - Full type safety throughout
12
23
  - 🌙 **Dark Mode** - Built-in theme support
13
- - 🌍 **i18n Ready** - Multi-language support included
14
- - ⚡ **Performance** - Optimized for speed and bundle size
15
- - 🎭 **Customizable** - Easy to theme and extend
24
+ - 🌍 **i18n** - 10+ languages included
25
+ - ⚡ **Performance** - Optimized for production
26
+ - 🎭 **Customizable** - SCSS modules for easy theming
16
27
 
17
28
  ## 🌶️ Pepper Router
18
29
 
@@ -35,22 +46,70 @@ npm install @chrryai/pepper
35
46
 
36
47
  ```bash
37
48
  npm install @chrryai/chrry
49
+ # or
50
+ pnpm add @chrryai/chrry
51
+ # or
52
+ yarn add @chrryai/chrry
38
53
  ```
39
54
 
40
55
  **Note:** Chrry is published as TypeScript source. Your bundler (Next.js, Vite, etc.) will compile it.
41
56
 
57
+ ---
58
+
42
59
  ## 🚀 Quick Start
43
60
 
61
+ ### Basic Usage
62
+
44
63
  ```tsx
45
- import { Button, Modal, Chat } from "@chrryai/chrry"
46
- import { Star, Heart } from "@chrryai/chrry/icons"
64
+ import { Chat, Button, Modal } from "@chrryai/chrry"
65
+ import { Star } from "@chrryai/chrry/icons"
47
66
 
48
67
  function App() {
49
68
  return (
50
- <div>
69
+ <>
70
+ <Chat />
51
71
  <Button>Click me</Button>
52
72
  <Star size={24} />
53
- </div>
73
+ </>
74
+ )
75
+ }
76
+ ```
77
+
78
+ ### With ChrryAI Layout (Full Next.js Integration)
79
+
80
+ ```tsx
81
+ import ChrryAI from "@chrryai/chrry/ChrryAI"
82
+ import { cookies, headers } from "next/headers"
83
+
84
+ export default async function RootLayout({ children }) {
85
+ const headersList = await headers()
86
+ const cookieStore = await cookies()
87
+
88
+ return (
89
+ <ChrryAI
90
+ apiKey={process.env.API_KEY}
91
+ locale="en"
92
+ headersList={headersList}
93
+ cookieStore={cookieStore}
94
+ >
95
+ {children}
96
+ </ChrryAI>
97
+ )
98
+ }
99
+ ```
100
+
101
+ ### With Standalone Chrry Provider
102
+
103
+ For non-Next.js apps or custom setups:
104
+
105
+ ```tsx
106
+ import Chrry from "@chrryai/chrry/Chrry"
107
+
108
+ export default function App({ children, session }) {
109
+ return (
110
+ <Chrry session={session} viewPortWidth="100vw" viewPortHeight="100vh">
111
+ {children}
112
+ </Chrry>
54
113
  )
55
114
  }
56
115
  ```
@@ -61,14 +120,56 @@ Visit [chrry.dev](https://chrry.dev) for full documentation, examples, and guide
61
120
 
62
121
  ## 🛠️ Components
63
122
 
64
- Chrry includes 50+ production-ready components:
123
+ ### AI & Chat
124
+
125
+ - **Chat** - Full-featured AI chat interface
126
+ - **Message** - Individual message component with streaming
127
+ - **Messages** - Message list with virtualization
128
+ - **Thread** - Complete thread view
129
+ - **Threads** - Thread list with search/filter
130
+ - **Agent** - AI agent selector
131
+ - **TypingIndicator** - Animated typing indicator
132
+
133
+ ### Layout
65
134
 
66
- - **Layout**: Sidebar, Menu, Modal, Skeleton
67
- - **Forms**: Input, Select, Checkbox, Search
68
- - **Data Display**: Message, Thread, Calendar, Weather
69
- - **Feedback**: Loading, Toast, EmptyState
70
- - **Navigation**: Breadcrumbs, Tabs, Pagination
71
- - **And many more...**
135
+ - **ChrryAI** - Complete app layout with session management
136
+ - **Sidebar** - Collapsible navigation sidebar
137
+ - **Menu** - Dropdown menu component
138
+ - **Modal** - Accessible modal dialogs
139
+ - **Skeleton** - Loading skeletons
140
+
141
+ ### Forms & Input
142
+
143
+ - **Button** - Customizable button component
144
+ - **Input** - Text input with validation
145
+ - **Select** - Dropdown select
146
+ - **Checkbox** - Checkbox with label
147
+ - **Search** - Search input with autocomplete
148
+ - **FileUpload** - Drag & drop file upload
149
+
150
+ ### Data Display
151
+
152
+ - **Calendar** - Full calendar with events
153
+ - **Weather** - Weather widget
154
+ - **CharacterProfiles** - AI personality profiles
155
+ - **Store** - App store interface
156
+ - **App** - Individual app card
157
+
158
+ ### Feedback
159
+
160
+ - **Loading** - Loading spinners
161
+ - **Toast** - Toast notifications
162
+ - **EmptyStateTips** - Empty state with tips
163
+ - **ConfirmButton** - Confirmation dialogs
164
+
165
+ ### Utilities
166
+
167
+ - **Image** - Optimized image component
168
+ - **MarkdownContent** - Markdown renderer
169
+ - **ColorScheme** - Theme switcher
170
+ - **LanguageSwitcher** - i18n language selector
171
+
172
+ **And 20+ more components!**
72
173
 
73
174
  ## 🎨 Theming
74
175
 
@@ -92,17 +193,76 @@ import { locale } from "@chrryai/chrry/locales"
92
193
  // Supports: en, es, fr, de, ja, ko, nl, pt, tr, zh
93
194
  ```
94
195
 
196
+ ## 🏗️ Architecture
197
+
198
+ Chrry is built with:
199
+
200
+ - **Next.js 15** - App Router with RSC
201
+ - **TypeScript 5** - Full type safety
202
+ - **SCSS Modules** - Scoped styling
203
+ - **Drizzle ORM** - Type-safe database queries
204
+ - **WebSockets** - Real-time features
205
+ - **next-intl** - Internationalization
206
+
207
+ ## 🌍 Supported Languages
208
+
209
+ - English (en)
210
+ - Spanish (es)
211
+ - French (fr)
212
+ - German (de)
213
+ - Japanese (ja)
214
+ - Korean (ko)
215
+ - Dutch (nl)
216
+ - Portuguese (pt)
217
+ - Turkish (tr)
218
+ - Chinese (zh)
219
+
95
220
  ## 🤝 Contributing
96
221
 
97
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
222
+ We welcome contributions! Chrry is extracted from [Vex](https://github.com/ibsukru/vex), a production AI platform.
223
+
224
+ ### Development
225
+
226
+ ```bash
227
+ # Clone the monorepo
228
+ git clone https://github.com/ibsukru/vex.git
229
+ cd vex
230
+
231
+ # Install dependencies
232
+ pnpm install
233
+
234
+ # Start development
235
+ pnpm dev
236
+ ```
237
+
238
+ ## 📄 License
239
+
240
+ MIT License - see [LICENSE](LICENSE) for details.
98
241
 
99
242
  ## 🔗 Links
100
243
 
101
- - [Website](https://chrry.dev)
102
- - [Documentation](https://chrry.dev/docs)
103
- - [GitHub](https://github.com/AskVex/chrry)
104
- - [npm](https://www.npmjs.com/package/@chrryai/chrry)
244
+ - **Website:** [chrry.dev](https://chrry.dev)
245
+ - **Documentation:** [chrry.dev/docs](https://chrry.dev/docs)
246
+ - **GitHub:** [@chrryai/chrry](https://github.com/chrryai/chrry)
247
+ - **npm:** [@chrryai/chrry](https://www.npmjs.com/package/@chrryai/chrry)
248
+ - **Chrry:** [chrry.ai](https://chrry.ai)
249
+ - **Vex:** [vex.chrry.ai](https://vex.chrry.ai)
250
+
251
+ ---
252
+
253
+ ## 💎 Why Chrry?
254
+
255
+ **Most AI component libraries are basic.** Chrry is different:
256
+
257
+ ✅ **Production-Ready** - Extracted from a real AI platform
258
+ ✅ **Complete** - 50+ components, not just a chat box
259
+ ✅ **Multi-Tenant** - Build app stores, not just apps
260
+ ✅ **Real-Time** - WebSocket collaboration built-in
261
+ ✅ **i18n** - 10 languages out of the box
262
+ ✅ **TypeScript** - Full type safety throughout
263
+
264
+ **This is a $10M+ component library, open-sourced for free.** 🎁
105
265
 
106
266
  ---
107
267
 
108
- **Built with ❤️ by the Vex team**
268
+ **Built with ❤️ by [@ibsukru](https://github.com/ibsukru)**
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import z$1, { z } from 'zod';
2
2
  import * as React from 'react';
3
3
  import React__default, { ReactNode } from 'react';
4
+ import { Metadata } from 'next';
4
5
 
5
6
  declare function useLocalStorage<T>(key: string, initialValue: T | (() => T)): readonly [T, (value: T | ((t: T) => T)) => Promise<void>];
6
7
 
@@ -132,6 +133,9 @@ type sessionUser = user;
132
133
  type sessionGuest = guest;
133
134
  type session = {
134
135
  env?: "development" | "production" | "staging";
136
+ TEST_GUEST_FINGERPRINTS?: string[];
137
+ TEST_MEMBER_FINGERPRINTS?: string[];
138
+ TEST_MEMBER_EMAILS?: string[];
135
139
  fingerprint?: string;
136
140
  token?: string;
137
141
  aiAgents?: aiAgent[];
@@ -827,8 +831,8 @@ declare const appSchema: z.ZodObject<{
827
831
  Peach: "Peach";
828
832
  Vault: "Vault";
829
833
  Bloom: "Bloom";
830
- Vex: "Vex";
831
834
  Chrry: "Chrry";
835
+ Vex: "Vex";
832
836
  }>, z.ZodString]>>>;
833
837
  onlyAgent: z.ZodOptional<z.ZodBoolean>;
834
838
  themeColor: z.ZodOptional<z.ZodString>;
@@ -842,6 +846,31 @@ declare const appSchema: z.ZodObject<{
842
846
  }, z.core.$strip>;
843
847
  type appFormData = z.infer<typeof appSchema>;
844
848
 
849
+ declare const getImageSrc: ({ app, icon, logo, store, PROD_FRONTEND_URL, src, slug, size, BASE_URL, width, height, canEditApp, image, }: {
850
+ slug?: "atlas" | "peach" | "vault" | "bloom";
851
+ className?: string;
852
+ size?: number;
853
+ title?: string;
854
+ showLoading?: boolean;
855
+ dataTestId?: string;
856
+ src?: string;
857
+ logo?: "lifeOS" | "isMagenta" | "isVivid" | "vex" | "chrry";
858
+ icon?: "spaceInvader" | "pacman" | "heart" | "plus" | "hamster" | "frog" | "calendar" | "deepSeek" | "perplexity" | "claude" | "chatGPT" | "gemini" | "flux" | "chrry" | "raspberry" | "strawberry";
859
+ app?: appWithStore;
860
+ width?: number | string;
861
+ height?: number | string;
862
+ onLoad?: () => void;
863
+ store?: store;
864
+ PROD_FRONTEND_URL?: string;
865
+ BASE_URL?: string;
866
+ canEditApp?: boolean;
867
+ image?: string;
868
+ }) => {
869
+ src: string;
870
+ width: number;
871
+ height: number;
872
+ size: number;
873
+ };
845
874
  declare const getThreads: ({ pageSize, token, search, sort, threadId, userName, collaborationStatus, myPendingCollaborations, onError, slug, appId, API_URL, }: {
846
875
  pageSize?: number;
847
876
  token: string;
@@ -1024,11 +1053,12 @@ declare function reorderApps({ token, apps, autoInstall, API_URL, }: {
1024
1053
  autoInstall?: boolean;
1025
1054
  API_URL?: string;
1026
1055
  }): Promise<any>;
1027
- declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, token, API_URL, VERSION, app, appSlug, agentName, chrryUrl, }: {
1056
+ declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, appId, token, API_URL, VERSION, app, appSlug, agentName, chrryUrl, routeType, userAgent, screenWidth, screenHeight, }: {
1057
+ appId?: string;
1028
1058
  deviceId: string | undefined;
1029
1059
  fingerprint?: string;
1030
1060
  gift?: string;
1031
- isStandalone: boolean;
1061
+ isStandalone?: boolean;
1032
1062
  token: string;
1033
1063
  API_URL?: string;
1034
1064
  VERSION?: string;
@@ -1036,6 +1066,10 @@ declare const getSession: ({ deviceId, fingerprint, gift, isStandalone, token, A
1036
1066
  appSlug?: string;
1037
1067
  agentName?: string;
1038
1068
  chrryUrl?: string;
1069
+ routeType?: string;
1070
+ userAgent?: string;
1071
+ screenWidth?: number;
1072
+ screenHeight?: number;
1039
1073
  }) => Promise<session | {
1040
1074
  error?: string;
1041
1075
  status?: number;
@@ -1199,6 +1233,25 @@ declare const getHourlyLimit: ({ member, guest, app, }: {
1199
1233
  }) | null;
1200
1234
  }) => 30 | 100 | 5000 | 500 | 200 | 10;
1201
1235
 
1236
+ /**
1237
+ * Generate dynamic metadata for an app page
1238
+ *
1239
+ * @example
1240
+ * ```typescript
1241
+ * export async function generateMetadata({ params }) {
1242
+ * const app = await getApp({ slug: params.slug })
1243
+ * const store = await getStore({ slug: params.id })
1244
+ * return generateAppMetadata({ app, store, locale: params.locale })
1245
+ * }
1246
+ * ```
1247
+ */
1248
+ declare function generateAppMetadata({ app, store, locale, currentDomain, }: {
1249
+ app: appWithStore;
1250
+ store: storeWithApps;
1251
+ locale?: string;
1252
+ currentDomain: string;
1253
+ }): Metadata;
1254
+
1202
1255
  type BrowserAPIType = typeof chrome | typeof browser;
1203
1256
 
1204
1257
  declare const checkIsExtension: () => boolean;
@@ -1225,12 +1278,9 @@ declare const PROMPT_LIMITS: {
1225
1278
  WARNING_THRESHOLD: number;
1226
1279
  THREAD_TITLE: number;
1227
1280
  };
1228
- declare const TEST_GUEST_FINGERPRINTS: string[];
1229
- declare const TEST_MEMBER_FINGERPRINTS: string[];
1230
1281
  declare const expenseCategory: readonly ["food", "transport", "entertainment", "shopping", "bills", "health", "education", "travel", "other"];
1231
1282
  type expenseCategoryType = (typeof expenseCategory)[number];
1232
1283
  declare const budgetCategory: readonly ["food", "transport", "entertainment", "shopping", "bills", "health", "education", "travel", "other"];
1233
- declare const TEST_MEMBER_EMAILS: string[];
1234
1284
  declare const isCI: string | undefined;
1235
1285
  declare const isE2E: boolean;
1236
1286
  declare const extensionSuggestions: {
@@ -1254,32 +1304,66 @@ declare const pageSizes: {
1254
1304
  declare const getBrowserAPI: () => BrowserAPIType | null;
1255
1305
  declare const BrowserInstance: BrowserAPIType | null;
1256
1306
  declare function capitalizeFirstLetter(val: string): string;
1307
+ declare const getMetadata: ({ title, description, keywords, robots, locale, alternates, }?: {
1308
+ manifest?: string;
1309
+ title?: string;
1310
+ description?: string;
1311
+ keywords?: string[];
1312
+ locale?: string;
1313
+ robots?: {
1314
+ index: boolean;
1315
+ follow: boolean;
1316
+ };
1317
+ alternates?: {
1318
+ canonical?: string;
1319
+ languages?: Record<string, string>;
1320
+ };
1321
+ }) => {
1322
+ openGraph: {
1323
+ title: string;
1324
+ description: string;
1325
+ url: string;
1326
+ siteName: string;
1327
+ images: {
1328
+ url: string;
1329
+ width: number;
1330
+ height: number;
1331
+ }[];
1332
+ locale: string;
1333
+ type: string;
1334
+ };
1335
+ twitter: {
1336
+ title: string;
1337
+ description: string;
1338
+ card: string;
1339
+ site: string;
1340
+ creator: string;
1341
+ images: {
1342
+ url: string;
1343
+ width: number;
1344
+ height: number;
1345
+ }[];
1346
+ };
1347
+ robots: {
1348
+ index: boolean;
1349
+ follow: boolean;
1350
+ } | undefined;
1351
+ keywords?: string | undefined;
1352
+ metadataBase: URL;
1353
+ alternates: {
1354
+ canonical?: string;
1355
+ languages?: Record<string, string>;
1356
+ };
1357
+ title: string;
1358
+ icons: string[];
1359
+ description: string;
1360
+ };
1257
1361
  declare const removeParam: (key: string) => void;
1258
- declare function trackPlausibleEvent({ name, url, domain, browser, device, os, props, isPWA, }: {
1259
- name: string;
1260
- url?: string;
1261
- domain?: string;
1262
- browser?: string;
1263
- device?: string;
1264
- os?: string;
1265
- isPWA?: boolean;
1266
- props?: Record<string, any>;
1267
- }): void;
1268
- declare const trackEvent: ({ name, url, domain, props, device, os, browser, isPWA, }: {
1269
- name: string;
1270
- url?: string;
1271
- domain?: string;
1272
- props?: Record<string, any>;
1273
- device?: string;
1274
- os?: string;
1275
- browser?: string;
1276
- isPWA?: boolean;
1277
- }) => void;
1278
1362
  declare const isFirefox: boolean;
1279
1363
  declare function getFlag({ code }: {
1280
1364
  code?: string;
1281
1365
  }): string;
1282
- declare const VERSION = "1.1.89";
1366
+ declare const VERSION = "1.1.95";
1283
1367
  type instructionBase = {
1284
1368
  id: string;
1285
1369
  title: string;
@@ -1416,4 +1500,4 @@ interface HistoryRouterProviderProps {
1416
1500
  */
1417
1501
  declare function HistoryRouterProvider({ children, }: HistoryRouterProviderProps): React.JSX.Element;
1418
1502
 
1419
- export { ADDITIONAL_CREDITS, API_URL, type ApiActions, BrowserInstance, CHRRY_URL, CREDITS_PRICE, type CalendarEventFormData, Chrry, FREE_DAYS, FRONTEND_URL, HistoryRouterProvider, MAX_FILE_SIZES, MAX_TOOL_CALLS_PER_MESSAGE, OWNER_CREDITS, PDF_LIMITS, PLUS_PRICE, PROD_FRONTEND_URL, PROMPT_LIMITS, PRO_PRICE, Sidebar, Store, TEST_GUEST_FINGERPRINTS, TEST_MEMBER_EMAILS, TEST_MEMBER_FINGERPRINTS, VERSION, WS_URL, addParam, apiFetch, budgetCategory, capitalizeFirstLetter, checkIsExtension, checkThreadSummaryLimit, createApp, createCalendarEvent, deleteApp, deleteCalendarEvent, deleteMemories, deleteMessage, deleteSubscription, exampleInstructions, expenseCategory, type expenseCategoryType, exportToGoogleCalendar, extensionSuggestions, getActions, getBrowserAPI, getBrowserIdentity, getCalendarEvents, getDailyImageLimit, getExampleInstructions, getExtensionUrl, getFlag, getGuest, getHourlyLimit, getInstructionConfig, getLastMessage, getRedirectURL, getSession, getThread, getThreads, getUser, getUsers, getWeatherCacheTime, type instructionBase, isCI, isCollaborator, isDeepEqual, isDevelopment, isE2E, isFirefox, isOwner, isValidUsername, pageSizes, removeParam, removeUser, reorderApps, storage, syncGoogleCalendar, trackEvent, trackPlausibleEvent, updateApp, updateCalendarEvent, updateCollaboration, updateGuest, updateMessage, updateThread, updateUser, uploadUserImage, useCountdown, useDeviceInfo, useHasHydrated, useLocalStorage, usePWAInstall };
1503
+ export { ADDITIONAL_CREDITS, API_URL, type ApiActions, BrowserInstance, CHRRY_URL, CREDITS_PRICE, type CalendarEventFormData, Chrry, FREE_DAYS, FRONTEND_URL, HistoryRouterProvider, MAX_FILE_SIZES, MAX_TOOL_CALLS_PER_MESSAGE, OWNER_CREDITS, PDF_LIMITS, PLUS_PRICE, PROD_FRONTEND_URL, PROMPT_LIMITS, PRO_PRICE, Sidebar, Store, VERSION, WS_URL, addParam, apiFetch, budgetCategory, capitalizeFirstLetter, checkIsExtension, checkThreadSummaryLimit, createApp, createCalendarEvent, deleteApp, deleteCalendarEvent, deleteMemories, deleteMessage, deleteSubscription, exampleInstructions, expenseCategory, type expenseCategoryType, exportToGoogleCalendar, extensionSuggestions, generateAppMetadata, getActions, getBrowserAPI, getBrowserIdentity, getCalendarEvents, getDailyImageLimit, getExampleInstructions, getExtensionUrl, getFlag, getGuest, getHourlyLimit, getImageSrc, getInstructionConfig, getLastMessage, getMetadata, getRedirectURL, getSession, getThread, getThreads, getUser, getUsers, getWeatherCacheTime, type instructionBase, isCI, isCollaborator, isDeepEqual, isDevelopment, isE2E, isFirefox, isOwner, isValidUsername, pageSizes, removeParam, removeUser, reorderApps, storage, syncGoogleCalendar, updateApp, updateCalendarEvent, updateCollaboration, updateGuest, updateMessage, updateThread, updateUser, uploadUserImage, useCountdown, useDeviceInfo, useHasHydrated, useLocalStorage, usePWAInstall };