@lobehub/lobehub 2.0.0-next.174 → 2.0.0-next.176

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.
Files changed (35) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +42 -0
  3. package/README.md +8 -8
  4. package/README.zh-CN.md +8 -8
  5. package/changelog/v1.json +14 -0
  6. package/docs/development/database-schema.dbml +26 -0
  7. package/next.config.ts +27 -0
  8. package/package.json +3 -1
  9. package/packages/agent-runtime/package.json +4 -1
  10. package/packages/const/package.json +5 -0
  11. package/packages/database/migrations/0064_add_agents_session_group_id.sql +7 -0
  12. package/packages/database/migrations/0065_add_passkey.sql +22 -0
  13. package/packages/database/migrations/0066_add_document_fields.sql +8 -0
  14. package/packages/database/migrations/meta/0064_snapshot.json +9143 -0
  15. package/packages/database/migrations/meta/0065_snapshot.json +9922 -0
  16. package/packages/database/migrations/meta/0066_snapshot.json +9962 -0
  17. package/packages/database/migrations/meta/_journal.json +21 -0
  18. package/packages/database/package.json +15 -0
  19. package/packages/database/src/core/migrations.json +64 -11
  20. package/packages/database/src/repositories/tableViewer/index.test.ts +1 -1
  21. package/packages/database/src/schemas/agent.ts +6 -0
  22. package/packages/database/src/schemas/betterAuth.ts +40 -1
  23. package/packages/database/src/schemas/file.ts +9 -3
  24. package/packages/electron-client-ipc/package.json +3 -0
  25. package/packages/model-bank/package.json +3 -0
  26. package/packages/model-runtime/package.json +18 -1
  27. package/packages/types/package.json +11 -0
  28. package/packages/utils/package.json +24 -2
  29. package/packages/web-crawler/package.json +1 -1
  30. package/public/.well-known/apple-app-site-association +5 -0
  31. package/public/.well-known/assetlinks.json +18 -0
  32. package/src/auth.ts +69 -1
  33. package/src/libs/better-auth/email-templates/index.ts +1 -0
  34. package/src/libs/better-auth/email-templates/verification-otp.ts +106 -0
  35. package/src/libs/better-auth/utils/config.ts +20 -1
package/.eslintrc.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const config = require('@lobehub/lint').eslint;
2
2
 
3
+ config.root = true;
3
4
  config.extends.push('plugin:@next/next/recommended');
4
5
 
5
6
  config.rules['unicorn/no-negated-condition'] = 0;
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.176](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.175...v2.0.0-next.176)
6
+
7
+ <sup>Released on **2025-12-23**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: Mobile native better auth support.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **misc**: Mobile native better auth support, closes [#10871](https://github.com/lobehub/lobe-chat/issues/10871) ([8c42a93](https://github.com/lobehub/lobe-chat/commit/8c42a93))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ## [Version 2.0.0-next.175](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.174...v2.0.0-next.175)
31
+
32
+ <sup>Released on **2025-12-21**</sup>
33
+
34
+ <br/>
35
+
36
+ <details>
37
+ <summary><kbd>Improvements and Fixes</kbd></summary>
38
+
39
+ </details>
40
+
41
+ <div align="right">
42
+
43
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
44
+
45
+ </div>
46
+
5
47
  ## [Version 2.0.0-next.174](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.173...v2.0.0-next.174)
6
48
 
7
49
  <sup>Released on **2025-12-20**</sup>
package/README.md CHANGED
@@ -345,14 +345,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
345
345
 
346
346
  <!-- PLUGIN LIST -->
347
347
 
348
- | Recent Submits | Description |
349
- | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
350
- | [Video Captions](https://lobechat.com/discover/plugin/VideoCaptions)<br/><sup>By **maila** on **2025-12-13**</sup> | Convert Youtube links into transcribed text, enable asking questions, create chapters, and summarize its content.<br/>`video-to-text` `youtube` |
351
- | [WeatherGPT](https://lobechat.com/discover/plugin/WeatherGPT)<br/><sup>By **steven-tey** on **2025-12-13**</sup> | Get current weather information for a specific location.<br/>`weather` |
352
- | [Git OSS Stats](https://lobechat.com/discover/plugin/gitUserRepoStats)<br/><sup>By **yunwei37** on **2025-12-13**</sup> | Dynamically generate and analyze stats and history for OSS repos and developers.<br/>`github` `oss` |
353
- | [Questmate Forms](https://lobechat.com/discover/plugin/questmate)<br/><sup>By **questmate** on **2025-12-13**</sup> | Create forms, checklists and workflows (we call 'em Quests!) that you can assign, schedule or make public.<br/>`forms` `checklists` `productivity` |
354
-
355
- > 📊 Total plugins: [<kbd>**39**</kbd>](https://lobechat.com/discover/plugins)
348
+ | Recent Submits | Description |
349
+ | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
350
+ | [Shopping tools](https://lobechat.com/discover/plugin/ShoppingTools)<br/><sup>By **shoppingtools** on **2025-12-17**</sup> | Search for products on eBay & AliExpress, find eBay events & coupons. Get prompt examples.<br/>`shopping` `e-bay` `ali-express` `coupons` |
351
+ | [SEO Assistant](https://lobechat.com/discover/plugin/seo_assistant)<br/><sup>By **webfx** on **2025-12-17**</sup> | The SEO Assistant can generate search engine keyword information in order to aid the creation of content.<br/>`seo` `keyword` |
352
+ | [Video Captions](https://lobechat.com/discover/plugin/VideoCaptions)<br/><sup>By **maila** on **2025-12-13**</sup> | Convert Youtube links into transcribed text, enable asking questions, create chapters, and summarize its content.<br/>`video-to-text` `youtube` |
353
+ | [WeatherGPT](https://lobechat.com/discover/plugin/WeatherGPT)<br/><sup>By **steven-tey** on **2025-12-13**</sup> | Get current weather information for a specific location.<br/>`weather` |
354
+
355
+ > 📊 Total plugins: [<kbd>**40**</kbd>](https://lobechat.com/discover/plugins)
356
356
 
357
357
  <!-- PLUGIN LIST -->
358
358
 
package/README.zh-CN.md CHANGED
@@ -338,14 +338,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
338
338
 
339
339
  <!-- PLUGIN LIST -->
340
340
 
341
- | 最近新增 | 描述 |
342
- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
343
- | [视频字幕](https://lobechat.com/discover/plugin/VideoCaptions)<br/><sup>By **maila** on **2025-12-13**</sup> | Youtube 链接转换为转录文本,使其能够提问,创建章节,并总结其内容。<br/>`视频转文字` `you-tube` |
344
- | [天气 GPT](https://lobechat.com/discover/plugin/WeatherGPT)<br/><sup>By **steven-tey** on **2025-12-13**</sup> | 获取特定位置的当前天气信息。<br/>`天气` |
345
- | [Git OSS Stats](https://lobechat.com/discover/plugin/gitUserRepoStats)<br/><sup>By **yunwei37** on **2025-12-13**</sup> | 动态生成和分析开源软件仓库和开发者的统计数据和历史记录。<br/>`github` `oss` |
346
- | [Questmate Forms](https://lobechat.com/discover/plugin/questmate)<br/><sup>By **questmate** on **2025-12-13**</sup> | 创建表单、清单和工作流程(我们称之为任务!),您可以分配、安排或公开。<br/>`表单` `清单` `生产力` |
347
-
348
- > 📊 Total plugins: [<kbd>**39**</kbd>](https://lobechat.com/discover/plugins)
341
+ | 最近新增 | 描述 |
342
+ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
343
+ | [购物工具](https://lobechat.com/discover/plugin/ShoppingTools)<br/><sup>By **shoppingtools** on **2025-12-17**</sup> | eBay 和 AliExpress 上搜索产品,查找 eBay 活动和优惠券。获取快速示例。<br/>`购物` `e-bay` `ali-express` `优惠券` |
344
+ | [SEO 助手](https://lobechat.com/discover/plugin/seo_assistant)<br/><sup>By **webfx** on **2025-12-17**</sup> | SEO 助手可以生成搜索引擎关键词信息,以帮助创建内容。<br/>`seo` `关键词` |
345
+ | [视频字幕](https://lobechat.com/discover/plugin/VideoCaptions)<br/><sup>By **maila** on **2025-12-13**</sup> | 将 Youtube 链接转换为转录文本,使其能够提问,创建章节,并总结其内容。<br/>`视频转文字` `you-tube` |
346
+ | [天气 GPT](https://lobechat.com/discover/plugin/WeatherGPT)<br/><sup>By **steven-tey** on **2025-12-13**</sup> | 获取特定位置的当前天气信息。<br/>`天气` |
347
+
348
+ > 📊 Total plugins: [<kbd>**40**</kbd>](https://lobechat.com/discover/plugins)
349
349
 
350
350
  <!-- PLUGIN LIST -->
351
351
 
package/changelog/v1.json CHANGED
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "features": [
5
+ "Mobile native better auth support."
6
+ ]
7
+ },
8
+ "date": "2025-12-23",
9
+ "version": "2.0.0-next.176"
10
+ },
11
+ {
12
+ "children": {},
13
+ "date": "2025-12-21",
14
+ "version": "2.0.0-next.175"
15
+ },
2
16
  {
3
17
  "children": {
4
18
  "improvements": [
@@ -22,6 +22,7 @@ table agents {
22
22
  pinned boolean
23
23
  opening_message text
24
24
  opening_questions text[] [default: `[]`]
25
+ session_group_id text
25
26
  accessed_at "timestamp with time zone" [not null, default: `now()`]
26
27
  created_at "timestamp with time zone" [not null, default: `now()`]
27
28
  updated_at "timestamp with time zone" [not null, default: `now()`]
@@ -32,6 +33,7 @@ table agents {
32
33
  user_id [name: 'agents_user_id_idx']
33
34
  title [name: 'agents_title_idx']
34
35
  description [name: 'agents_description_idx']
36
+ session_group_id [name: 'agents_session_group_id_idx']
35
37
  }
36
38
  }
37
39
 
@@ -170,6 +172,25 @@ table accounts {
170
172
  }
171
173
  }
172
174
 
175
+ table passkey {
176
+ aaguid text
177
+ backedUp boolean
178
+ counter integer
179
+ createdAt timestamp [default: `now()`]
180
+ credentialID text [not null]
181
+ deviceType text
182
+ id text [pk, not null]
183
+ name text
184
+ publicKey text [not null]
185
+ transports text
186
+ userId text [not null]
187
+
188
+ indexes {
189
+ credentialID [name: 'passkey_credential_id_unique', unique]
190
+ userId [name: 'passkey_user_id_idx']
191
+ }
192
+ }
193
+
173
194
  table auth_sessions {
174
195
  created_at timestamp [not null, default: `now()`]
175
196
  expires_at timestamp [not null]
@@ -249,6 +270,7 @@ table chat_groups_agents {
249
270
  table documents {
250
271
  id varchar(255) [pk, not null]
251
272
  title text
273
+ description text
252
274
  content text
253
275
  file_type varchar(255) [not null]
254
276
  filename text
@@ -259,6 +281,7 @@ table documents {
259
281
  source_type text [not null]
260
282
  source text [not null]
261
283
  file_id text
284
+ knowledge_base_id text
262
285
  parent_id varchar(255)
263
286
  user_id text [not null]
264
287
  client_id text
@@ -275,6 +298,7 @@ table documents {
275
298
  user_id [name: 'documents_user_id_idx']
276
299
  file_id [name: 'documents_file_id_idx']
277
300
  parent_id [name: 'documents_parent_id_idx']
301
+ knowledge_base_id [name: 'documents_knowledge_base_id_idx']
278
302
  (client_id, user_id) [name: 'documents_client_id_user_id_unique', unique]
279
303
  (slug, user_id) [name: 'documents_slug_user_id_unique', unique]
280
304
  }
@@ -1266,6 +1290,8 @@ table user_memories_preferences {
1266
1290
 
1267
1291
  ref: accounts.user_id > users.id
1268
1292
 
1293
+ ref: passkey.userId > users.id
1294
+
1269
1295
  ref: auth_sessions.user_id > users.id
1270
1296
 
1271
1297
  ref: two_factor.user_id > users.id
package/next.config.ts CHANGED
@@ -192,6 +192,33 @@ const nextConfig: NextConfig = {
192
192
  ],
193
193
  source: '/apple-touch-icon.png',
194
194
  },
195
+ // Passkey configuration files for iOS and Android
196
+ {
197
+ headers: [
198
+ {
199
+ key: 'Content-Type',
200
+ value: 'application/json',
201
+ },
202
+ {
203
+ key: 'Cache-Control',
204
+ value: 'public, max-age=3600',
205
+ },
206
+ ],
207
+ source: '/.well-known/apple-app-site-association',
208
+ },
209
+ {
210
+ headers: [
211
+ {
212
+ key: 'Content-Type',
213
+ value: 'application/json',
214
+ },
215
+ {
216
+ key: 'Cache-Control',
217
+ value: 'public, max-age=3600',
218
+ },
219
+ ],
220
+ source: '/.well-known/assetlinks.json',
221
+ },
195
222
  ];
196
223
  },
197
224
  logging: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.174",
3
+ "version": "2.0.0-next.176",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -136,6 +136,8 @@
136
136
  "@aws-sdk/s3-request-presigner": "~3.932.0",
137
137
  "@azure-rest/ai-inference": "1.0.0-beta.5",
138
138
  "@azure/core-auth": "^1.10.1",
139
+ "@better-auth/expo": "^1.4.6",
140
+ "@better-auth/passkey": "^1.4.6",
139
141
  "@cfworker/json-schema": "^4.1.1",
140
142
  "@clerk/localizations": "^3.30.1",
141
143
  "@clerk/nextjs": "^6.36.2",
@@ -8,7 +8,10 @@
8
8
  "test": "vitest",
9
9
  "test:coverage": "vitest --coverage --silent='passed-only'"
10
10
  },
11
- "dependencies": {},
11
+ "dependencies": {
12
+ "@lobechat/types": "workspace:*",
13
+ "p-map": "^7.0.4"
14
+ },
12
15
  "devDependencies": {
13
16
  "openai": "^4.104.0"
14
17
  }
@@ -8,6 +8,11 @@
8
8
  },
9
9
  "main": "./src/index.ts",
10
10
  "dependencies": {
11
+ "@icons-pack/react-simple-icons": "^13.8.0",
12
+ "@lobechat/types": "workspace:*",
13
+ "@lobehub/ui": "^2.13.8",
14
+ "klavis": "^2.15.0",
15
+ "lodash-es": "^4.17.21",
11
16
  "model-bank": "workspace:*",
12
17
  "query-string": "^9.3.1",
13
18
  "url-join": "^5.0.0"
@@ -0,0 +1,7 @@
1
+ ALTER TABLE "agents" ADD COLUMN IF NOT EXISTS "session_group_id" text;--> statement-breakpoint
2
+ DO $$ BEGIN
3
+ IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'agents_session_group_id_session_groups_id_fk') THEN
4
+ ALTER TABLE "agents" ADD CONSTRAINT "agents_session_group_id_session_groups_id_fk" FOREIGN KEY ("session_group_id") REFERENCES "public"."session_groups"("id") ON DELETE set null ON UPDATE no action;
5
+ END IF;
6
+ END $$;--> statement-breakpoint
7
+ CREATE INDEX IF NOT EXISTS "agents_session_group_id_idx" ON "agents" USING btree ("session_group_id");
@@ -0,0 +1,22 @@
1
+ CREATE TABLE IF NOT EXISTS "passkey" (
2
+ "aaguid" text,
3
+ "backedUp" boolean,
4
+ "counter" integer,
5
+ "createdAt" timestamp DEFAULT now(),
6
+ "credentialID" text NOT NULL,
7
+ "deviceType" text,
8
+ "id" text PRIMARY KEY NOT NULL,
9
+ "name" text,
10
+ "publicKey" text NOT NULL,
11
+ "transports" text,
12
+ "userId" text NOT NULL
13
+ );
14
+ --> statement-breakpoint
15
+ DO $$ BEGIN
16
+ IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'passkey_userId_users_id_fk') THEN
17
+ ALTER TABLE "passkey" ADD CONSTRAINT "passkey_userId_users_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
18
+ END IF;
19
+ END $$;
20
+ --> statement-breakpoint
21
+ CREATE UNIQUE INDEX IF NOT EXISTS "passkey_credential_id_unique" ON "passkey" USING btree ("credentialID");--> statement-breakpoint
22
+ CREATE INDEX IF NOT EXISTS "passkey_user_id_idx" ON "passkey" USING btree ("userId");
@@ -0,0 +1,8 @@
1
+ ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "description" text;--> statement-breakpoint
2
+ ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "knowledge_base_id" text;--> statement-breakpoint
3
+ DO $$ BEGIN
4
+ IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'documents_knowledge_base_id_knowledge_bases_id_fk') THEN
5
+ ALTER TABLE "documents" ADD CONSTRAINT "documents_knowledge_base_id_knowledge_bases_id_fk" FOREIGN KEY ("knowledge_base_id") REFERENCES "public"."knowledge_bases"("id") ON DELETE set null ON UPDATE no action;
6
+ END IF;
7
+ END $$;--> statement-breakpoint
8
+ CREATE INDEX IF NOT EXISTS "documents_knowledge_base_id_idx" ON "documents" USING btree ("knowledge_base_id");