@lobehub/chat 1.108.0 → 1.108.1

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 (58) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +3 -2
  3. package/README.zh-CN.md +3 -2
  4. package/changelog/v1.json +12 -0
  5. package/package.json +2 -2
  6. package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +1 -1
  7. package/src/app/[variants]/layout.tsx +1 -0
  8. package/src/database/models/__tests__/_test_template.ts +1 -1
  9. package/src/database/models/__tests__/agent.test.ts +1 -1
  10. package/src/database/models/__tests__/aiModel.test.ts +1 -1
  11. package/src/database/models/__tests__/aiProvider.test.ts +1 -1
  12. package/src/database/models/__tests__/asyncTask.test.ts +1 -1
  13. package/src/database/models/__tests__/chunk.test.ts +1 -1
  14. package/src/database/models/__tests__/file.test.ts +1 -1
  15. package/src/database/models/__tests__/generationTopic.test.ts +1 -1
  16. package/src/database/models/__tests__/knowledgeBase.test.ts +1 -1
  17. package/src/database/models/__tests__/message.test.ts +1 -1
  18. package/src/database/models/__tests__/session.test.ts +1 -1
  19. package/src/database/models/__tests__/sessionGroup.test.ts +1 -1
  20. package/src/database/models/__tests__/topic.test.ts +1 -1
  21. package/src/database/models/_template.ts +1 -1
  22. package/src/database/models/agent.ts +1 -1
  23. package/src/database/models/aiModel.ts +1 -1
  24. package/src/database/models/aiProvider.ts +1 -1
  25. package/src/database/models/apiKey.ts +1 -1
  26. package/src/database/models/asyncTask.ts +1 -1
  27. package/src/database/models/chunk.ts +1 -2
  28. package/src/database/models/document.ts +1 -1
  29. package/src/database/models/embedding.ts +1 -2
  30. package/src/database/models/file.ts +1 -2
  31. package/src/database/models/generationTopic.ts +1 -1
  32. package/src/database/models/knowledgeBase.ts +1 -1
  33. package/src/database/models/message.ts +1 -2
  34. package/src/database/models/plugin.ts +1 -1
  35. package/src/database/models/session.ts +15 -2
  36. package/src/database/models/sessionGroup.ts +1 -1
  37. package/src/database/models/thread.ts +1 -1
  38. package/src/database/models/topic.ts +1 -2
  39. package/src/database/models/user.ts +1 -1
  40. package/src/database/repositories/dataExporter/index.ts +1 -1
  41. package/src/database/repositories/dataImporter/__tests__/index.test.ts +1 -1
  42. package/src/database/repositories/dataImporter/deprecated/__tests__/index.test.ts +1 -1
  43. package/src/database/repositories/dataImporter/deprecated/index.ts +1 -2
  44. package/src/database/repositories/dataImporter/index.ts +1 -1
  45. package/src/database/server/models/__tests__/adapter.test.ts +1 -1
  46. package/src/database/server/models/__tests__/nextauth.test.ts +1 -1
  47. package/src/database/server/models/__tests__/user.test.ts +1 -1
  48. package/src/database/server/models/ragEval/dataset.ts +1 -1
  49. package/src/database/server/models/ragEval/datasetRecord.ts +1 -1
  50. package/src/database/server/models/ragEval/evaluation.ts +1 -2
  51. package/src/database/server/models/ragEval/evaluationRecord.ts +1 -1
  52. package/src/database/utils/genWhere.ts +1 -2
  53. package/src/features/User/UserAvatar.tsx +18 -2
  54. package/src/libs/next-auth/adapter/index.ts +1 -1
  55. package/src/libs/oidc-provider/adapter.ts +1 -2
  56. package/src/server/routers/lambda/chunk.ts +1 -1
  57. package/src/services/session/client.test.ts +1 -1
  58. package/src/styles/antdOverride.ts +6 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.108.1](https://github.com/lobehub/lobe-chat/compare/v1.108.0...v1.108.1)
6
+
7
+ <sup>Released on **2025-08-05**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix remote avatar broken in desktop.
12
+
13
+ #### 💄 Styles
14
+
15
+ - **misc**: Update mask style.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's fixed
23
+
24
+ - **misc**: Fix remote avatar broken in desktop, closes [#8673](https://github.com/lobehub/lobe-chat/issues/8673) ([7eae430](https://github.com/lobehub/lobe-chat/commit/7eae430))
25
+
26
+ #### Styles
27
+
28
+ - **misc**: Update mask style, closes [#8555](https://github.com/lobehub/lobe-chat/issues/8555) ([b4ac89d](https://github.com/lobehub/lobe-chat/commit/b4ac89d))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
5
38
  ## [Version 1.108.0](https://github.com/lobehub/lobe-chat/compare/v1.107.6...v1.108.0)
6
39
 
7
40
  <sup>Released on **2025-08-05**</sup>
package/README.md CHANGED
@@ -250,7 +250,7 @@ We have implemented support for the following model service providers:
250
250
  - **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: The HuggingFace Inference API provides a fast and free way for you to explore thousands of models for various tasks. Whether you are prototyping for a new application or experimenting with the capabilities of machine learning, this API gives you instant access to high-performance models across multiple domains.
251
251
  - **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: Run serverless GPU-powered machine learning models on Cloudflare's global network.
252
252
 
253
- <details><summary><kbd>See more providers (+31)</kbd></summary>
253
+ <details><summary><kbd>See more providers (+32)</kbd></summary>
254
254
 
255
255
  - **[GitHub](https://lobechat.com/discover/provider/github)**: With GitHub Models, developers can become AI engineers and leverage the industry's leading AI models.
256
256
  - **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI is a platform providing a variety of large language models and AI image generation API services, flexible, reliable, and cost-effective. It supports the latest open-source models like Llama3 and Mistral, offering a comprehensive, user-friendly, and auto-scaling API solution for generative AI application development, suitable for the rapid growth of AI startups.
@@ -283,10 +283,11 @@ We have implemented support for the following model service providers:
283
283
  - **[Search1API](https://lobechat.com/discover/provider/search1api)**: Search1API provides access to the DeepSeek series of models that can connect to the internet as needed, including standard and fast versions, supporting a variety of model sizes.
284
284
  - **[InfiniAI](https://lobechat.com/discover/provider/infiniai)**: Provides high-performance, easy-to-use, and secure large model services for application developers, covering the entire process from large model development to service deployment.
285
285
  - **[Qiniu](https://lobechat.com/discover/provider/qiniu)**: Qiniu, as a long-established cloud service provider, delivers cost-effective and reliable AI inference services for both real-time and batch processing, with a simple and user-friendly experience.
286
+ - **[302.AI](https://lobechat.com/discover/provider/ai302)**:
286
287
 
287
288
  </details>
288
289
 
289
- > 📊 Total providers: [<kbd>**41**</kbd>](https://lobechat.com/discover/providers)
290
+ > 📊 Total providers: [<kbd>**42**</kbd>](https://lobechat.com/discover/providers)
290
291
 
291
292
  <!-- PROVIDER LIST -->
292
293
 
package/README.zh-CN.md CHANGED
@@ -250,7 +250,7 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
250
250
  - **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: HuggingFace Inference API 提供了一种快速且免费的方式,让您可以探索成千上万种模型,适用于各种任务。无论您是在为新应用程序进行原型设计,还是在尝试机器学习的功能,这个 API 都能让您即时访问多个领域的高性能模型。
251
251
  - **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: 在 Cloudflare 的全球网络上运行由无服务器 GPU 驱动的机器学习模型。
252
252
 
253
- <details><summary><kbd>See more providers (+31)</kbd></summary>
253
+ <details><summary><kbd>See more providers (+32)</kbd></summary>
254
254
 
255
255
  - **[GitHub](https://lobechat.com/discover/provider/github)**: 通过 GitHub 模型,开发人员可以成为 AI 工程师,并使用行业领先的 AI 模型进行构建。
256
256
  - **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI 是一个提供多种大语言模型与 AI 图像生成的 API 服务的平台,灵活、可靠且具有成本效益。它支持 Llama3、Mistral 等最新的开源模型,并为生成式 AI 应用开发提供了全面、用户友好且自动扩展的 API 解决方案,适合 AI 初创公司的快速发展。
@@ -283,10 +283,11 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
283
283
  - **[Search1API](https://lobechat.com/discover/provider/search1api)**: Search1API 提供可根据需要自行联网的 DeepSeek 系列模型的访问,包括标准版和快速版本,支持多种参数规模的模型选择。
284
284
  - **[InfiniAI](https://lobechat.com/discover/provider/infiniai)**: 为应用开发者提供高性能、易上手、安全可靠的大模型服务,覆盖从大模型开发到大模型服务化部署的全流程。
285
285
  - **[Qiniu](https://lobechat.com/discover/provider/qiniu)**: 七牛作为老牌云服务厂商,提供高性价比稳定的实时、批量 AI 推理服务,简单易用。
286
+ - **[302.AI](https://lobechat.com/discover/provider/ai302)**:
286
287
 
287
288
  </details>
288
289
 
289
- > 📊 Total providers: [<kbd>**41**</kbd>](https://lobechat.com/discover/providers)
290
+ > 📊 Total providers: [<kbd>**42**</kbd>](https://lobechat.com/discover/providers)
290
291
 
291
292
  <!-- PROVIDER LIST -->
292
293
 
package/changelog/v1.json CHANGED
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix remote avatar broken in desktop."
6
+ ],
7
+ "improvements": [
8
+ "Update mask style."
9
+ ]
10
+ },
11
+ "date": "2025-08-05",
12
+ "version": "1.108.1"
13
+ },
2
14
  {
3
15
  "children": {
4
16
  "features": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.108.0",
3
+ "version": "1.108.1",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot 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",
@@ -182,7 +182,7 @@
182
182
  "debug": "^4.4.1",
183
183
  "dexie": "^3.2.7",
184
184
  "diff": "^7.0.0",
185
- "drizzle-orm": "^0.41.0",
185
+ "drizzle-orm": "^0.44.0",
186
186
  "drizzle-zod": "^0.5.1",
187
187
  "epub2": "^3.0.2",
188
188
  "fast-deep-equal": "^3.1.3",
@@ -15,7 +15,7 @@ const handler = (req: NextRequest) =>
15
15
  endpoint: '/trpc/desktop',
16
16
 
17
17
  onError: ({ error, path, type }) => {
18
- pino.info(`Error in tRPC handler (tools) on path: ${path}, type: ${type}`);
18
+ pino.info(`Error in tRPC handler (desktop) on path: ${path}, type: ${type}`);
19
19
  console.error(error);
20
20
  },
21
21
 
@@ -34,6 +34,7 @@ const RootLayout = async ({ children, params, modal }: RootLayoutProps) => {
34
34
  <html dir={direction} lang={locale} suppressHydrationWarning>
35
35
  <head>
36
36
  {process.env.DEBUG_REACT_SCAN === '1' && (
37
+ // eslint-disable-next-line @next/next/no-sync-scripts
37
38
  <script crossOrigin="anonymous" src="https://unpkg.com/react-scan/dist/auto.global.js" />
38
39
  )}
39
40
  </head>
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq, inArray } from 'drizzle-orm/expressions';
2
+ import { eq, inArray } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { and, eq } from 'drizzle-orm/expressions';
2
+ import { and, eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,5 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { getTestDB } from '@/database/models/__tests__/_util';
@@ -1,4 +1,4 @@
1
- import { and, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, eq, inArray } from 'drizzle-orm';
2
2
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
3
3
 
4
4
  import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { LobeChatDatabase } from '@/database/type';
@@ -1,4 +1,4 @@
1
- import { eq, inArray } from 'drizzle-orm/expressions';
1
+ import { eq, inArray } from 'drizzle-orm';
2
2
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
3
3
 
4
4
  import { LobeChatDatabase } from '@/database/type';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
 
@@ -1,4 +1,4 @@
1
- import { and, desc, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq, inArray } from 'drizzle-orm';
2
2
 
3
3
  import {
4
4
  agents,
@@ -1,4 +1,4 @@
1
- import { and, asc, desc, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, asc, desc, eq, inArray } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import {
@@ -1,4 +1,4 @@
1
- import { and, asc, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, asc, desc, eq } from 'drizzle-orm';
2
2
  import { isEmpty } from 'lodash-es';
3
3
 
4
4
  import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import { generateApiKey, isApiKeyExpired, validateApiKeyFormat } from '@/utils/apiKey';
@@ -1,4 +1,4 @@
1
- import { and, eq, inArray, lt } from 'drizzle-orm/expressions';
1
+ import { and, eq, inArray, lt } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import {
@@ -1,5 +1,4 @@
1
- import { cosineDistance, count, sql } from 'drizzle-orm';
2
- import { and, asc, desc, eq, inArray, isNull } from 'drizzle-orm/expressions';
1
+ import { and, asc, cosineDistance, count, desc, eq, inArray, isNull, sql } from 'drizzle-orm';
3
2
  import { chunk } from 'lodash-es';
4
3
 
5
4
  import { LobeChatDatabase } from '@/database/type';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
 
@@ -1,5 +1,4 @@
1
- import { count } from 'drizzle-orm';
2
- import { and, eq } from 'drizzle-orm/expressions';
1
+ import { and, count, eq } from 'drizzle-orm';
3
2
 
4
3
  import { LobeChatDatabase } from '@/database/type';
5
4
 
@@ -1,5 +1,4 @@
1
- import { count, sum } from 'drizzle-orm';
2
- import { and, asc, desc, eq, ilike, inArray, like, notExists, or } from 'drizzle-orm/expressions';
1
+ import { and, asc, count, desc, eq, ilike, inArray, like, notExists, or, sum } from 'drizzle-orm';
3
2
  import type { PgTransaction } from 'drizzle-orm/pg-core';
4
3
 
5
4
  import { LobeChatDatabase, Transaction } from '@/database/type';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import { FileService } from '@/server/services/file';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq, inArray } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import { KnowledgeBaseItem } from '@/types/knowledgeBase';
@@ -1,7 +1,6 @@
1
1
  import type { HeatmapsProps } from '@lobehub/charts';
2
2
  import dayjs from 'dayjs';
3
- import { count, sql } from 'drizzle-orm';
4
- import { and, asc, desc, eq, gt, inArray, isNotNull, isNull, like } from 'drizzle-orm/expressions';
3
+ import { and, asc, count, desc, eq, gt, inArray, isNotNull, isNull, like, sql } from 'drizzle-orm';
5
4
 
6
5
  import { LobeChatDatabase } from '@/database/type';
7
6
  import {
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import { LobeTool } from '@/types/tool';
@@ -1,5 +1,18 @@
1
- import { Column, count, sql } from 'drizzle-orm';
2
- import { and, asc, desc, eq, gt, inArray, isNull, like, not, or } from 'drizzle-orm/expressions';
1
+ import {
2
+ Column,
3
+ and,
4
+ asc,
5
+ count,
6
+ desc,
7
+ eq,
8
+ gt,
9
+ inArray,
10
+ isNull,
11
+ like,
12
+ not,
13
+ or,
14
+ sql,
15
+ } from 'drizzle-orm';
3
16
  import type { PartialDeep } from 'type-fest';
4
17
 
5
18
  import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
@@ -1,4 +1,4 @@
1
- import { and, asc, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, asc, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import { idGenerator } from '@/database/utils/idGenerator';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { LobeChatDatabase } from '@/database/type';
4
4
  import { CreateThreadParams, ThreadStatus } from '@/types/topic';
@@ -1,5 +1,4 @@
1
- import { count, sql } from 'drizzle-orm';
2
- import { and, desc, eq, gt, ilike, inArray, isNull } from 'drizzle-orm/expressions';
1
+ import { and, count, desc, eq, gt, ilike, inArray, isNull, sql } from 'drizzle-orm';
3
2
 
4
3
  import { LobeChatDatabase } from '@/database/type';
5
4
  import {
@@ -1,6 +1,6 @@
1
1
  import { TRPCError } from '@trpc/server';
2
2
  import dayjs from 'dayjs';
3
- import { eq } from 'drizzle-orm/expressions';
3
+ import { eq } from 'drizzle-orm';
4
4
  import type { AdapterAccount } from 'next-auth/adapters';
5
5
  import type { PartialDeep } from 'type-fest';
6
6
 
@@ -1,4 +1,4 @@
1
- import { and, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, eq, inArray } from 'drizzle-orm';
2
2
  import pMap from 'p-map';
3
3
 
4
4
  import * as EXPORT_TABLES from '@/database/schemas';
@@ -1,4 +1,4 @@
1
- import { eq, inArray } from 'drizzle-orm/expressions';
1
+ import { eq, inArray } from 'drizzle-orm';
2
2
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
3
3
 
4
4
  import { getTestDB } from '@/database/models/__tests__/_util';
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment node
2
- import { eq, inArray } from 'drizzle-orm/expressions';
2
+ import { eq, inArray } from 'drizzle-orm';
3
3
  import { beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
5
  import { getTestDBInstance } from '@/database/core/dbForTest';
@@ -1,5 +1,4 @@
1
- import { sql } from 'drizzle-orm';
2
- import { and, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, eq, inArray, sql } from 'drizzle-orm';
3
2
 
4
3
  import {
5
4
  agents,
@@ -1,4 +1,4 @@
1
- import { and, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, eq, inArray } from 'drizzle-orm';
2
2
 
3
3
  import * as EXPORT_TABLES from '@/database/schemas';
4
4
  import { LobeChatDatabase } from '@/database/type';
@@ -1,4 +1,4 @@
1
- import { eq } from 'drizzle-orm/expressions';
1
+ import { eq } from 'drizzle-orm';
2
2
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
3
3
 
4
4
  import { getTestDBInstance } from '@/database/core/dbForTest';
@@ -5,7 +5,7 @@ import type {
5
5
  AdapterUser,
6
6
  VerificationToken,
7
7
  } from '@auth/core/adapters';
8
- import { eq } from 'drizzle-orm/expressions';
8
+ import { eq } from 'drizzle-orm';
9
9
  import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
10
10
 
11
11
  import { getTestDBInstance } from '@/database/core/dbForTest';
@@ -1,6 +1,6 @@
1
1
  import { TRPCError } from '@trpc/server';
2
2
  import dayjs from 'dayjs';
3
- import { eq } from 'drizzle-orm/expressions';
3
+ import { eq } from 'drizzle-orm';
4
4
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
5
5
 
6
6
  import { INBOX_SESSION_ID } from '@/const/session';
@@ -1,4 +1,4 @@
1
- import { and, desc, eq } from 'drizzle-orm/expressions';
1
+ import { and, desc, eq } from 'drizzle-orm';
2
2
 
3
3
  import { NewEvalDatasetsItem, evalDatasets } from '@/database/schemas';
4
4
  import { serverDB } from '@/database/server';
@@ -1,4 +1,4 @@
1
- import { and, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { and, eq, inArray } from 'drizzle-orm';
2
2
 
3
3
  import { NewEvalDatasetRecordsItem, evalDatasetRecords, files } from '@/database/schemas';
4
4
  import { serverDB } from '@/database/server';
@@ -1,5 +1,4 @@
1
- import { SQL, count } from 'drizzle-orm';
2
- import { and, desc, eq, inArray } from 'drizzle-orm/expressions';
1
+ import { SQL, and, count, desc, eq, inArray } from 'drizzle-orm';
3
2
 
4
3
  import {
5
4
  NewEvalEvaluationItem,
@@ -1,4 +1,4 @@
1
- import { and, eq } from 'drizzle-orm/expressions';
1
+ import { and, eq } from 'drizzle-orm';
2
2
 
3
3
  import { NewEvaluationRecordsItem, evaluationRecords } from '@/database/schemas';
4
4
  import { serverDB } from '@/database/server';
@@ -1,6 +1,5 @@
1
1
  import dayjs, { Dayjs } from 'dayjs';
2
- import { SQL } from 'drizzle-orm';
3
- import { and, gte, lte } from 'drizzle-orm/expressions';
2
+ import { SQL, and, gte, lte } from 'drizzle-orm';
4
3
 
5
4
  export const genWhere = (sqls: (SQL<any> | undefined)[]): SQL<any> | undefined => {
6
5
  const where = sqls.filter(Boolean);
@@ -2,10 +2,13 @@
2
2
 
3
3
  import { Avatar, type AvatarProps } from '@lobehub/ui';
4
4
  import { createStyles } from 'antd-style';
5
- import { forwardRef } from 'react';
5
+ import { forwardRef, useMemo } from 'react';
6
6
 
7
7
  import { BRANDING_NAME } from '@/const/branding';
8
8
  import { DEFAULT_USER_AVATAR_URL } from '@/const/meta';
9
+ import { isDesktop } from '@/const/version';
10
+ import { useElectronStore } from '@/store/electron';
11
+ import { electronSyncSelectors } from '@/store/electron/selectors';
9
12
  import { useUserStore } from '@/store/user';
10
13
  import { authSelectors, userProfileSelectors } from '@/store/user/selectors';
11
14
 
@@ -54,11 +57,24 @@ const UserAvatar = forwardRef<HTMLDivElement, UserAvatarProps>(
54
57
  ]);
55
58
 
56
59
  const isSignedIn = useUserStore(authSelectors.isLogin);
60
+ const remoteServerUrl = useElectronStore(electronSyncSelectors.remoteServerUrl);
61
+
62
+ // Process avatar URL for desktop environment
63
+ const avatarUrl = useMemo(() => {
64
+ if (!isSignedIn || !avatar) return DEFAULT_USER_AVATAR_URL;
65
+
66
+ // If in desktop environment and avatar starts with /, prepend the remote server URL
67
+ if (isDesktop && avatar.startsWith('/') && remoteServerUrl) {
68
+ return remoteServerUrl + avatar;
69
+ }
70
+
71
+ return avatar;
72
+ }, [isSignedIn, avatar, remoteServerUrl]);
57
73
 
58
74
  return (
59
75
  <Avatar
60
76
  alt={isSignedIn && !!username ? username : BRANDING_NAME}
61
- avatar={isSignedIn && !!avatar ? avatar : DEFAULT_USER_AVATAR_URL}
77
+ avatar={avatarUrl}
62
78
  background={isSignedIn && avatar ? background : 'transparent'}
63
79
  className={cx(clickable && styles.clickable, className)}
64
80
  ref={ref}
@@ -4,7 +4,7 @@ import type {
4
4
  AdapterUser,
5
5
  VerificationToken,
6
6
  } from '@auth/core/adapters';
7
- import { and, eq } from 'drizzle-orm/expressions';
7
+ import { and, eq } from 'drizzle-orm';
8
8
  import type { NeonDatabase } from 'drizzle-orm/neon-serverless';
9
9
  import { Adapter, AdapterAccount } from 'next-auth/adapters';
10
10
 
@@ -1,6 +1,5 @@
1
1
  import debug from 'debug';
2
- import { sql } from 'drizzle-orm';
3
- import { eq } from 'drizzle-orm/expressions';
2
+ import { eq, sql } from 'drizzle-orm';
4
3
 
5
4
  import {
6
5
  oidcAccessTokens,
@@ -1,5 +1,5 @@
1
1
  import { TRPCError } from '@trpc/server';
2
- import { inArray } from 'drizzle-orm/expressions';
2
+ import { inArray } from 'drizzle-orm';
3
3
  import { z } from 'zod';
4
4
 
5
5
  import { DEFAULT_FILE_EMBEDDING_MODEL_ITEM } from '@/const/settings/knowledge';
@@ -1,4 +1,4 @@
1
- import { eq, not } from 'drizzle-orm/expressions';
1
+ import { eq, not } from 'drizzle-orm';
2
2
  import { Mock, beforeEach, describe, expect, it, vi } from 'vitest';
3
3
 
4
4
  import { INBOX_SESSION_ID } from '@/const/session';
@@ -1,4 +1,5 @@
1
1
  import { Theme, css } from 'antd-style';
2
+ import { rgba } from 'polished';
2
3
 
3
4
  export default ({ token }: { prefixCls: string; token: Theme }) => css`
4
5
  .${token.prefixCls}-popover {
@@ -15,4 +16,9 @@ export default ({ token }: { prefixCls: string; token: Theme }) => css`
15
16
  color: ${token.colorText};
16
17
  }
17
18
  }
19
+
20
+ .${token.prefixCls}-modal-mask, .${token.prefixCls}-drawer-mask {
21
+ background: ${rgba(token.colorBgLayout, 0.5)} !important;
22
+ backdrop-filter: blur(2px);
23
+ }
18
24
  `;