@lobehub/chat 1.84.5 → 1.84.7

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 (63) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/apps/desktop/Development.md +466 -18
  3. package/apps/desktop/README.md +60 -0
  4. package/changelog/v1.json +18 -0
  5. package/locales/ar/error.json +4 -1
  6. package/locales/ar/plugin.json +8 -0
  7. package/locales/bg-BG/error.json +4 -1
  8. package/locales/bg-BG/plugin.json +8 -0
  9. package/locales/de-DE/error.json +4 -1
  10. package/locales/de-DE/plugin.json +8 -0
  11. package/locales/en-US/error.json +4 -1
  12. package/locales/en-US/plugin.json +8 -0
  13. package/locales/es-ES/error.json +4 -1
  14. package/locales/es-ES/plugin.json +8 -0
  15. package/locales/fa-IR/error.json +4 -1
  16. package/locales/fa-IR/plugin.json +8 -0
  17. package/locales/fr-FR/error.json +4 -1
  18. package/locales/fr-FR/plugin.json +8 -0
  19. package/locales/it-IT/error.json +4 -1
  20. package/locales/it-IT/plugin.json +8 -0
  21. package/locales/ja-JP/error.json +4 -1
  22. package/locales/ja-JP/plugin.json +8 -0
  23. package/locales/ko-KR/error.json +4 -1
  24. package/locales/ko-KR/plugin.json +8 -0
  25. package/locales/nl-NL/error.json +4 -1
  26. package/locales/nl-NL/plugin.json +8 -0
  27. package/locales/pl-PL/error.json +4 -1
  28. package/locales/pl-PL/plugin.json +8 -0
  29. package/locales/pt-BR/error.json +4 -1
  30. package/locales/pt-BR/plugin.json +8 -0
  31. package/locales/ru-RU/error.json +4 -1
  32. package/locales/ru-RU/plugin.json +8 -0
  33. package/locales/tr-TR/error.json +4 -1
  34. package/locales/tr-TR/plugin.json +8 -0
  35. package/locales/vi-VN/error.json +4 -1
  36. package/locales/vi-VN/plugin.json +8 -0
  37. package/locales/zh-CN/error.json +3 -0
  38. package/locales/zh-CN/plugin.json +8 -0
  39. package/locales/zh-TW/error.json +4 -1
  40. package/locales/zh-TW/plugin.json +8 -0
  41. package/package.json +1 -1
  42. package/src/app/[variants]/(main)/repos/[id]/_layout/Desktop/index.tsx +2 -7
  43. package/src/app/[variants]/(main)/repos/[id]/_layout/Mobile.tsx +2 -12
  44. package/src/app/[variants]/(main)/repos/[id]/_layout/type.ts +0 -1
  45. package/src/app/[variants]/(main)/repos/[id]/features/Menu/index.tsx +18 -0
  46. package/src/app/[variants]/(main)/repos/[id]/page.tsx +16 -3
  47. package/src/app/[variants]/(main)/settings/provider/(detail)/[id]/page.tsx +2 -2
  48. package/src/config/aiModels/openrouter.ts +134 -18
  49. package/src/features/PluginDevModal/MCPManifestForm/index.tsx +28 -7
  50. package/src/features/PluginDevModal/PluginPreview/ApiVisualizer.tsx +12 -4
  51. package/src/features/PluginDevModal/PluginPreview/EmptyState.tsx +2 -3
  52. package/src/libs/mcp/types.ts +1 -1
  53. package/src/libs/trpc/client/helpers/desktopRemoteRPCFetch.ts +1 -1
  54. package/src/locales/default/error.ts +3 -0
  55. package/src/locales/default/plugin.ts +8 -0
  56. package/src/server/routers/desktop/mcp.ts +10 -1
  57. package/src/server/routers/tools/mcp.ts +11 -1
  58. package/src/server/services/mcp/index.ts +35 -12
  59. package/src/services/mcp.ts +14 -3
  60. package/src/types/tool/plugin.ts +12 -2
  61. package/src/app/[variants]/(main)/repos/[id]/@menu/default.tsx +0 -33
  62. /package/src/app/[variants]/(main)/repos/[id]/{@menu → features/Menu}/Head/index.tsx +0 -0
  63. /package/src/app/[variants]/(main)/repos/[id]/{@menu → features/Menu}/Menu/index.tsx +0 -0
@@ -54,12 +54,20 @@
54
54
  "placeholder": "Например: --port 8080 --debug",
55
55
  "required": "Пожалуйста, введите параметры запуска"
56
56
  },
57
+ "avatar": {
58
+ "label": "Иконка плагина"
59
+ },
57
60
  "command": {
58
61
  "desc": "Исполняемый файл или скрипт для запуска плагина MCP STDIO",
59
62
  "label": "Команда",
60
63
  "placeholder": "Например: python main.py или /path/to/executable",
61
64
  "required": "Пожалуйста, введите команду запуска"
62
65
  },
66
+ "desc": {
67
+ "desc": "Добавьте описание плагина",
68
+ "label": "Описание плагина",
69
+ "placeholder": "Дополните информацию о использовании и сценариях данного плагина"
70
+ },
63
71
  "endpoint": {
64
72
  "desc": "Введите адрес вашего MCP Streamable HTTP Server",
65
73
  "label": "URL-адрес MCP Endpoint"
@@ -66,6 +66,7 @@
66
66
  "429": "Üzgünüz, isteğiniz çok fazla, sunucu biraz yoruldu, lütfen daha sonra tekrar deneyin",
67
67
  "431": "Üzgünüz, istek başlık alanı çok büyük, sunucu işleyemiyor",
68
68
  "451": "Üzgünüz, yasal nedenlerle sunucu bu kaynağı sağlamayı reddediyor",
69
+ "499": "Üzgünüz, isteğiniz sunucu işleminde beklenmedik bir şekilde kesildi, bu muhtemelen işlemi iptal etmeniz veya ağ bağlantısının kararsız olmasından kaynaklanıyor. Lütfen ağ durumunu kontrol edip tekrar deneyin.",
69
70
  "500": "Üzgünüm, sunucu bazı zorluklar yaşıyor ve geçici olarak isteğinizi tamamlayamıyor. Lütfen daha sonra tekrar deneyin.",
70
71
  "501": "Üzgünüm, sunucu bu isteği nasıl işleyeceğini henüz bilmiyor, lütfen işleminizin doğru olduğundan emin olun",
71
72
  "502": "Üzgünüm, sunucu kayboldu ve geçici olarak hizmet veremiyor. Lütfen daha sonra tekrar deneyin.",
@@ -76,7 +77,9 @@
76
77
  "507": "Üzgünüm, sunucunun depolama alanı yetersiz, isteğinizi işleyemiyor, lütfen daha sonra tekrar deneyin",
77
78
  "509": "Üzgünüm, sunucunun bant genişliği tükendi, lütfen daha sonra tekrar deneyin",
78
79
  "510": "Üzgünüm, sunucu isteğinizi genişletme işlevini desteklemiyor, lütfen yöneticinizle iletişime geçin",
79
- "524": "Üzgünüm, sunucu yanıt beklerken zaman aşımına uğradı, bu muhtemelen yanıtın çok yavaş olmasından kaynaklanıyor, lütfen daha sonra tekrar deneyin",
80
+ "520": "Üzgünüz, sunucu beklenmedik bir sorunla karşılaştı ve isteğinizi tamamlayamadı. Lütfen daha sonra tekrar deneyin, bu sorunu çözmek için çalışıyoruz.",
81
+ "522": "Üzgünüz, sunucu bağlantısı zaman aşımına uğradı ve isteğinize zamanında yanıt veremedi. Bu, ağın kararsız olmasından veya sunucunun geçici olarak erişilememesinden kaynaklanıyor olabilir. Lütfen daha sonra tekrar deneyin, hizmeti geri getirmek için çalışıyoruz.",
82
+ "524": "Üzgünüz, sunucu yanıt beklerken zaman aşımına uğradı, bu muhtemelen yanıtın çok yavaş olmasından kaynaklanıyor. Lütfen daha sonra tekrar deneyin.",
80
83
  "AgentRuntimeError": "Lobe dil modeli çalışma zamanı hatası, lütfen aşağıdaki bilgilere göre sorunu gidermeye çalışın veya tekrar deneyin",
81
84
  "ConnectionCheckFailed": "İstek boş döndü, lütfen API代理地址ının sonuna `/v1` ekleyip eklemediğinizi kontrol edin.",
82
85
  "CreateMessageError": "Üzgünüm, mesaj düzgün bir şekilde gönderilemedi. Lütfen içeriği kopyalayın ve yeniden gönderin, sayfayı yeniledikten sonra bu mesaj kaydedilmeyecek.",
@@ -54,12 +54,20 @@
54
54
  "placeholder": "Örneğin: --port 8080 --debug",
55
55
  "required": "Lütfen başlatma parametrelerini girin"
56
56
  },
57
+ "avatar": {
58
+ "label": "Eklenti İkonu"
59
+ },
57
60
  "command": {
58
61
  "desc": "MCP STDIO eklentisini başlatmak için kullanılacak yürütülebilir dosya veya betik",
59
62
  "label": "Komut",
60
63
  "placeholder": "Örneğin: python main.py veya /path/to/executable",
61
64
  "required": "Lütfen başlatma komutunu girin"
62
65
  },
66
+ "desc": {
67
+ "desc": "Eklentinin açıklama bilgisi ekleyin",
68
+ "label": "Eklenti Açıklaması",
69
+ "placeholder": "Bu eklentinin kullanım talimatları ve senaryoları gibi bilgileri ekleyin"
70
+ },
63
71
  "endpoint": {
64
72
  "desc": "MCP Streamable HTTP Sunucunuzun adresini girin",
65
73
  "label": "MCP Endpoint URL"
@@ -66,6 +66,7 @@
66
66
  "429": "Xin lỗi, yêu cầu của bạn quá nhiều, máy chủ hơi mệt, vui lòng thử lại sau",
67
67
  "431": "Xin lỗi, trường tiêu đề yêu cầu của bạn quá lớn, máy chủ không thể xử lý",
68
68
  "451": "Xin lỗi, do lý do pháp lý, máy chủ từ chối cung cấp tài nguyên này",
69
+ "499": "Xin lỗi, yêu cầu của bạn đã bị gián đoạn một cách bất ngờ trong quá trình xử lý trên máy chủ, có thể do bạn đã hủy bỏ thao tác hoặc kết nối mạng không ổn định. Vui lòng kiểm tra tình trạng mạng và thử lại.",
69
70
  "500": "Xin lỗi, máy chủ có vẻ gặp một số khó khăn, tạm thời không thể hoàn thành yêu cầu của bạn, vui lòng thử lại sau",
70
71
  "501": "Xin lỗi, máy chủ chưa biết cách xử lý yêu cầu này, vui lòng xác nhận rằng thao tác của bạn là chính xác",
71
72
  "502": "Xin lỗi, máy chủ có vẻ lạc đường, tạm thời không thể cung cấp dịch vụ, vui lòng thử lại sau",
@@ -76,7 +77,9 @@
76
77
  "507": "Xin lỗi, máy chủ không đủ dung lượng lưu trữ để xử lý yêu cầu của bạn, vui lòng thử lại sau",
77
78
  "509": "Xin lỗi, băng thông của máy chủ đã hết, vui lòng thử lại sau",
78
79
  "510": "Xin lỗi, máy chủ không hỗ trợ chức năng mở rộng được yêu cầu, vui lòng liên hệ với quản trị viên",
79
- "524": "Xin lỗi, máy chủ đã hết thời gian chờ khi đang chờ phản hồi, thể do phản hồi quá chậm, vui lòng thử lại sau",
80
+ "520": "Xin lỗi, máy chủ đã gặp phải một vấn đề bất ngờ, dẫn đến việc không thể hoàn thành yêu cầu của bạn. Vui lòng thử lại sau, chúng tôi đang nỗ lực khắc phục vấn đề này.",
81
+ "522": "Xin lỗi, kết nối máy chủ đã hết thời gian chờ, không thể phản hồi yêu cầu của bạn kịp thời. Có thể do mạng không ổn định hoặc máy chủ tạm thời không thể truy cập. Vui lòng thử lại sau, chúng tôi đang nỗ lực phục hồi dịch vụ.",
82
+ "524": "Xin lỗi, máy chủ đã hết thời gian chờ khi đang chờ phản hồi, có thể do phản hồi quá chậm, vui lòng thử lại sau.",
80
83
  "AgentRuntimeError": "Lobe mô hình ngôn ngữ thực thi gặp lỗi, vui lòng kiểm tra và thử lại dựa trên thông tin dưới đây",
81
84
  "ConnectionCheckFailed": "Yêu cầu trả về trống, xin kiểm tra xem địa chỉ API proxy có đang thiếu `/v1` ở cuối không",
82
85
  "CreateMessageError": "Xin lỗi, tin nhắn không thể được gửi đi bình thường, vui lòng sao chép nội dung và gửi lại, tin nhắn này sẽ không được lưu lại sau khi làm mới trang.",
@@ -54,12 +54,20 @@
54
54
  "placeholder": "Ví dụ: mcp-hello-world",
55
55
  "required": "Vui lòng nhập tham số khởi động"
56
56
  },
57
+ "avatar": {
58
+ "label": "Biểu tượng tiện ích"
59
+ },
57
60
  "command": {
58
61
  "desc": "Tập tin thực thi hoặc kịch bản dùng để khởi động Máy chủ MCP STDIO",
59
62
  "label": "Lệnh",
60
63
  "placeholder": "Ví dụ: npx / uv / docker v.v.",
61
64
  "required": "Vui lòng nhập lệnh khởi động"
62
65
  },
66
+ "desc": {
67
+ "desc": "Mô tả về tiện ích",
68
+ "label": "Mô tả tiện ích",
69
+ "placeholder": "Bổ sung thông tin về cách sử dụng và các tình huống của tiện ích này"
70
+ },
63
71
  "endpoint": {
64
72
  "desc": "Nhập địa chỉ của máy chủ HTTP Streamable MCP của bạn",
65
73
  "label": "URL Điểm cuối MCP"
@@ -66,6 +66,7 @@
66
66
  "429": "很抱歉,您的请求太多,服务器有点累了,请稍后再试",
67
67
  "431": "很抱歉,您的请求头字段太大,服务器无法处理",
68
68
  "451": "很抱歉,由于法律原因,服务器拒绝提供此资源",
69
+ "499": "很抱歉,您的请求在服务器处理中被意外中断,可能是因为您主动取消了操作或网络连接不稳定。请检查网络状况后重试。",
69
70
  "500": "很抱歉,服务器似乎遇到了一些困难,暂时无法完成您的请求,请稍后再试",
70
71
  "501": "很抱歉,服务器还不知道如何处理这个请求,请确认您的操作是否正确",
71
72
  "502": "很抱歉,服务器似乎迷失了方向,暂时无法提供服务,请稍后再试",
@@ -76,6 +77,8 @@
76
77
  "507": "很抱歉,服务器存储空间不足,无法处理您的请求,请稍后再试",
77
78
  "509": "很抱歉,服务器的带宽已用尽,请稍后再试",
78
79
  "510": "很抱歉,服务器不支持请求的扩展功能,请联系管理员",
80
+ "520": "很抱歉,服务器遇到了一个意外的问题,导致无法完成您的请求。请稍后再试,我们正努力解决这个问题。",
81
+ "522": "很抱歉,服务器连接超时,未能及时响应您的请求。可能是网络不稳定或服务器暂时无法访问。请稍后再试,我们正在努力恢复服务。",
79
82
  "524": "很抱歉,服务器在等回复时超时了,可能是因为响应太慢,请稍后再试",
80
83
  "PluginMarketIndexNotFound": "很抱歉,服务器没有找到插件索引,请检查索引地址是否正确",
81
84
  "PluginMarketIndexInvalid": "很抱歉,插件索引校验未通过,请检查索引文件格式是否规范",
@@ -54,12 +54,20 @@
54
54
  "placeholder": "例如:mcp-hello-world",
55
55
  "required": "请输入启动参数"
56
56
  },
57
+ "avatar": {
58
+ "label": "插件图标"
59
+ },
57
60
  "command": {
58
61
  "desc": "用于启动 MCP STDIO Server 的可执行文件或脚本",
59
62
  "label": "命令",
60
63
  "placeholder": "例如:npx / uv / docker 等",
61
64
  "required": "请输入启动命令"
62
65
  },
66
+ "desc": {
67
+ "desc": "添加插件的描述说明",
68
+ "label": "插件描述",
69
+ "placeholder": "补充该插件的使用说明和场景等信息"
70
+ },
63
71
  "endpoint": {
64
72
  "desc": "输入你的 MCP Streamable HTTP Server 的地址",
65
73
  "label": "MCP Endpoint URL"
@@ -66,6 +66,7 @@
66
66
  "429": "很抱歉,您的請求太多,伺服器有點累了,請稍後再試",
67
67
  "431": "很抱歉,您的請求頭字段太大,伺服器無法處理",
68
68
  "451": "很抱歉,由於法律原因,伺服器拒絕提供此資源",
69
+ "499": "很抱歉,您的請求在伺服器處理中被意外中斷,可能是因為您主動取消了操作或網路連接不穩定。請檢查網路狀況後重試。",
69
70
  "500": "抱歉,伺服器似乎遇到一些困難,暫時無法完成您的請求。請稍後再試。",
70
71
  "501": "很抱歉,伺服器尚未知道如何處理此請求,請確認您的操作是否正確",
71
72
  "502": "抱歉,伺服器似乎迷失了方向,暫時無法提供服務。請稍後再試。",
@@ -76,7 +77,9 @@
76
77
  "507": "很抱歉,伺服器儲存空間不足,無法處理您的請求,請稍後再試",
77
78
  "509": "很抱歉,伺服器的頻寬已用盡,請稍後再試",
78
79
  "510": "很抱歉,伺服器不支援請求的擴展功能,請聯繫管理員",
79
- "524": "很抱歉,伺服器在等待回覆時超時,可能是因為回應太慢,請稍後再試",
80
+ "520": "很抱歉,伺服器遇到了意外的問題,導致無法完成您的請求。請稍後再試,我們正努力解決這個問題。",
81
+ "522": "很抱歉,伺服器連接超時,未能及時響應您的請求。可能是網路不穩定或伺服器暫時無法訪問。請稍後再試,我們正在努力恢復服務。",
82
+ "524": "很抱歉,伺服器在等回覆時超時了,可能是因為回應太慢,請稍後再試",
80
83
  "AgentRuntimeError": "Lobe 語言模型運行時執行出錯,請根據以下信息排查或重試",
81
84
  "ConnectionCheckFailed": "請求返回為空,請檢查 API 代理地址末尾是否未包含 `/v1`",
82
85
  "CreateMessageError": "很抱歉,訊息未能正常發送,請複製內容後重新發送,刷新頁面後此訊息將不會保留",
@@ -54,12 +54,20 @@
54
54
  "placeholder": "例如:--port 8080 --debug",
55
55
  "required": "請輸入啟動參數"
56
56
  },
57
+ "avatar": {
58
+ "label": "插件圖示"
59
+ },
57
60
  "command": {
58
61
  "desc": "用於啟動 MCP STDIO 插件的可執行文件或腳本",
59
62
  "label": "命令",
60
63
  "placeholder": "例如:python main.py 或 /path/to/executable",
61
64
  "required": "請輸入啟動命令"
62
65
  },
66
+ "desc": {
67
+ "desc": "添加插件的描述說明",
68
+ "label": "插件描述",
69
+ "placeholder": "補充該插件的使用說明和場景等資訊"
70
+ },
63
71
  "endpoint": {
64
72
  "desc": "輸入你的 MCP Streamable HTTP Server 的地址",
65
73
  "label": "MCP Endpoint URL"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.84.5",
3
+ "version": "1.84.7",
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",
@@ -1,10 +1,8 @@
1
1
  import { Flexbox } from 'react-layout-kit';
2
2
 
3
- import FilePanel from '@/features/FileSidePanel';
4
-
5
3
  import { LayoutProps } from '../type';
6
4
 
7
- const Layout = ({ children, menu }: LayoutProps) => {
5
+ const Layout = ({ children }: LayoutProps) => {
8
6
  return (
9
7
  <Flexbox
10
8
  height={'100%'}
@@ -12,10 +10,7 @@ const Layout = ({ children, menu }: LayoutProps) => {
12
10
  style={{ maxWidth: 'calc(100vw - 64px)', overflow: 'hidden', position: 'relative' }}
13
11
  width={'100%'}
14
12
  >
15
- <FilePanel>{menu}</FilePanel>
16
- <Flexbox flex={1} style={{ overflow: 'hidden', position: 'relative' }}>
17
- {children}
18
- </Flexbox>
13
+ {children}
19
14
  </Flexbox>
20
15
  );
21
16
  };
@@ -16,29 +16,19 @@ const useStyles = createStyles(({ css, token }) => ({
16
16
  `,
17
17
  }));
18
18
 
19
- const Layout = memo<LayoutProps>(({ children, menu }) => {
19
+ const Layout = memo<LayoutProps>(({ children }) => {
20
20
  const showMobileWorkspace = useShowMobileWorkspace();
21
21
  const { styles } = useStyles();
22
22
 
23
23
  return (
24
- <>
25
- <Flexbox
24
+ <Flexbox
26
25
  className={styles.main}
27
26
  height="100%"
28
27
  style={showMobileWorkspace ? { display: 'none' } : undefined}
29
28
  width="100%"
30
- >
31
- {menu}
32
- </Flexbox>
33
- <Flexbox
34
- className={styles.main}
35
- height="100%"
36
- style={showMobileWorkspace ? undefined : { display: 'none' }}
37
- width="100%"
38
29
  >
39
30
  {children}
40
31
  </Flexbox>
41
- </>
42
32
  );
43
33
  });
44
34
 
@@ -2,5 +2,4 @@ import { ReactNode } from 'react';
2
2
 
3
3
  export interface LayoutProps {
4
4
  children: ReactNode;
5
- menu: ReactNode;
6
5
  }
@@ -0,0 +1,18 @@
1
+ import { memo } from 'react';
2
+ import { Flexbox } from 'react-layout-kit';
3
+
4
+ import Head from './Head';
5
+ import Menu from './Menu';
6
+
7
+ type Props = { id: string; name: string };
8
+
9
+ const ComposeMenu = memo<Props>(({ id, name }) => (
10
+ <Flexbox gap={16} height={'100%'} paddingInline={12} style={{ paddingTop: 12 }}>
11
+ <Head name={name} />
12
+ <Menu id={id} />
13
+ </Flexbox>
14
+ ));
15
+
16
+ ComposeMenu.displayName = 'ComposeMenu';
17
+
18
+ export default ComposeMenu;
@@ -1,16 +1,29 @@
1
1
  import { redirect } from 'next/navigation';
2
+ import { Flexbox } from 'react-layout-kit';
2
3
 
3
4
  import { KnowledgeBaseModel } from '@/database/models/knowledgeBase';
4
- import { serverDB } from '@/database/server';
5
+ import { getServerDB } from '@/database/server';
5
6
  import FileManager from '@/features/FileManager';
7
+ import FilePanel from '@/features/FileSidePanel';
6
8
  import { PagePropsWithId } from '@/types/next';
7
9
 
10
+ import Menu from './features/Menu';
11
+
8
12
  export default async (props: PagePropsWithId) => {
9
13
  const params = await props.params;
10
14
 
15
+ const serverDB = await getServerDB();
11
16
  const item = await KnowledgeBaseModel.findById(serverDB, params.id);
12
-
13
17
  if (!item) return redirect('/repos');
14
18
 
15
- return <FileManager knowledgeBaseId={params.id} title={item.name} />;
19
+ return (
20
+ <>
21
+ <FilePanel>
22
+ <Menu id={params.id} name={item.name} />
23
+ </FilePanel>
24
+ <Flexbox flex={1} style={{ overflow: 'hidden', position: 'relative' }}>
25
+ <FileManager knowledgeBaseId={params.id} title={item.name} />
26
+ </Flexbox>
27
+ </>
28
+ );
16
29
  };
@@ -1,7 +1,7 @@
1
1
  import { redirect } from 'next/navigation';
2
2
 
3
3
  import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
4
- import { isServerMode } from '@/const/version';
4
+ import { isDesktop, isServerMode } from '@/const/version';
5
5
  import { AiInfraRepos } from '@/database/repositories/aiInfra';
6
6
  import { serverDB } from '@/database/server';
7
7
  import { getServerGlobalConfig } from '@/server/globalConfig';
@@ -21,7 +21,7 @@ const Page = async (props: PagePropsWithId) => {
21
21
  if (!!builtinProviderCard) return <ProviderDetail source={'builtin'} {...builtinProviderCard} />;
22
22
 
23
23
  // if user custom provider
24
- if (isServerMode) {
24
+ if (!isDesktop && isServerMode) {
25
25
  const { userId } = await getUserAuth();
26
26
 
27
27
  const { aiProvider } = await getServerGlobalConfig();
@@ -12,7 +12,6 @@ const openrouterChatModels: AIChatModelCard[] = [
12
12
  },
13
13
  {
14
14
  abilities: {
15
- functionCall: true,
16
15
  reasoning: true,
17
16
  },
18
17
  contextWindowTokens: 40_960,
@@ -24,7 +23,6 @@ const openrouterChatModels: AIChatModelCard[] = [
24
23
  },
25
24
  {
26
25
  abilities: {
27
- functionCall: true,
28
26
  reasoning: true,
29
27
  },
30
28
  contextWindowTokens: 40_960,
@@ -41,7 +39,6 @@ const openrouterChatModels: AIChatModelCard[] = [
41
39
  },
42
40
  {
43
41
  abilities: {
44
- functionCall: true,
45
42
  reasoning: true,
46
43
  },
47
44
  contextWindowTokens: 40_960,
@@ -54,7 +51,6 @@ const openrouterChatModels: AIChatModelCard[] = [
54
51
  },
55
52
  {
56
53
  abilities: {
57
- functionCall: true,
58
54
  reasoning: true,
59
55
  },
60
56
  contextWindowTokens: 40_960,
@@ -66,7 +62,6 @@ const openrouterChatModels: AIChatModelCard[] = [
66
62
  },
67
63
  {
68
64
  abilities: {
69
- functionCall: true,
70
65
  reasoning: true,
71
66
  },
72
67
  contextWindowTokens: 40_960,
@@ -83,7 +78,6 @@ const openrouterChatModels: AIChatModelCard[] = [
83
78
  },
84
79
  {
85
80
  abilities: {
86
- functionCall: true,
87
81
  reasoning: true,
88
82
  },
89
83
  contextWindowTokens: 40_960,
@@ -95,7 +89,6 @@ const openrouterChatModels: AIChatModelCard[] = [
95
89
  },
96
90
  {
97
91
  abilities: {
98
- functionCall: true,
99
92
  reasoning: true,
100
93
  },
101
94
  contextWindowTokens: 40_960,
@@ -111,7 +104,6 @@ const openrouterChatModels: AIChatModelCard[] = [
111
104
  },
112
105
  {
113
106
  abilities: {
114
- functionCall: true,
115
107
  reasoning: true,
116
108
  },
117
109
  contextWindowTokens: 40_960,
@@ -123,7 +115,6 @@ const openrouterChatModels: AIChatModelCard[] = [
123
115
  },
124
116
  {
125
117
  abilities: {
126
- functionCall: true,
127
118
  reasoning: true,
128
119
  },
129
120
  contextWindowTokens: 40_960,
@@ -155,7 +146,7 @@ const openrouterChatModels: AIChatModelCard[] = [
155
146
  },
156
147
  contextWindowTokens: 32_000,
157
148
  description:
158
- 'THUDM: GLM Z1 Rumination 32B 是 GLM-4-Z1 系列中的 32B 参数深度推理模型,针对需要长时间思考的复杂、开放式任务进行了优化。它建立在 glm-4-32b-0414 的基础上,增加了额外的强化学习阶段和多阶段对齐策略,引入了旨在模拟扩展认知处理的“反思”能力。这包括迭代推理、多跳分析和工具增强的工作流程,例如搜索、检索和引文感知合成。\n\n该模型在研究式写作、比较分析和复杂问答方面表现出色。它支持用于搜索和导航原语(`search`、`click`、`open`、`finish`)的函数调用,从而可以在代理式管道中使用。反思行为由具有基于规则的奖励塑造和延迟决策机制的多轮循环控制,并以 OpenAI 内部对齐堆栈等深度研究框架为基准。此变体适用于需要深度而非速度的场景。',
149
+ 'GLM Z1 Rumination 32B 是 GLM-4-Z1 系列中的 32B 参数深度推理模型,针对需要长时间思考的复杂、开放式任务进行了优化。它建立在 glm-4-32b-0414 的基础上,增加了额外的强化学习阶段和多阶段对齐策略,引入了旨在模拟扩展认知处理的“反思”能力。这包括迭代推理、多跳分析和工具增强的工作流程,例如搜索、检索和引文感知合成。\n\n该模型在研究式写作、比较分析和复杂问答方面表现出色。它支持用于搜索和导航原语(`search`、`click`、`open`、`finish`)的函数调用,从而可以在代理式管道中使用。反思行为由具有基于规则的奖励塑造和延迟决策机制的多轮循环控制,并以 OpenAI 内部对齐堆栈等深度研究框架为基准。此变体适用于需要深度而非速度的场景。',
159
150
  displayName: 'GLM Z1 Rumination 32B',
160
151
  id: 'thudm/glm-z1-rumination-32b',
161
152
  pricing: {
@@ -176,9 +167,6 @@ const openrouterChatModels: AIChatModelCard[] = [
176
167
  type: 'chat',
177
168
  },
178
169
  {
179
- abilities: {
180
- functionCall: true,
181
- },
182
170
  contextWindowTokens: 32_000,
183
171
  description:
184
172
  'GLM-4-9B-0414 是 THUDM 开发的 GLM-4 系列中的 90 亿参数语言模型。GLM-4-9B-0414 使用与其较大的 32B 对应模型相同的强化学习和对齐策略进行训练,相对于其规模实现了高性能,使其适用于仍需要强大语言理解和生成能力的资源受限部署。',
@@ -186,6 +174,113 @@ const openrouterChatModels: AIChatModelCard[] = [
186
174
  id: 'thudm/glm-4-9b:free',
187
175
  type: 'chat',
188
176
  },
177
+ {
178
+ abilities: {
179
+ functionCall: true,
180
+ reasoning: true,
181
+ vision: true,
182
+ },
183
+ contextWindowTokens: 1_048_576,
184
+ description:
185
+ 'Gemini 2.5 Pro 是 Google 最先进的 AI 模型,专为高级推理、编码、数学和科学任务而设计。它采用“思考”能力,使其能够以更高的准确性和细致的上下文处理来推理响应。Gemini 2.5 Pro 在多个基准测试中取得了顶级性能,包括在 LMArena 排行榜上排名第一,反映了卓越的人类偏好对齐和复杂问题解决能力。',
186
+ displayName: 'Gemini 2.5 Pro Preview',
187
+ id: 'google/gemini-2.5-pro-preview-03-25',
188
+ maxOutput: 65_535,
189
+ pricing: {
190
+ cachedInput: 0.625,
191
+ input: 1.25,
192
+ output: 10,
193
+ },
194
+ type: 'chat',
195
+ },
196
+ {
197
+ abilities: {
198
+ reasoning: true,
199
+ },
200
+ contextWindowTokens: 32_768,
201
+ description:
202
+ 'GLM-Z1-32B-0414 是 GLM-4-32B 的增强推理变体,专为深度数学、逻辑和面向代码的问题解决而构建。它应用扩展强化学习(任务特定和基于通用成对偏好)来提高复杂多步骤任务的性能。与基础 GLM-4-32B 模型相比,Z1 显著提升了结构化推理和形式化领域的能力。\n\n该模型支持通过提示工程强制执行“思考”步骤,并为长格式输出提供改进的连贯性。它针对代理工作流进行了优化,并支持长上下文(通过 YaRN)、JSON 工具调用和用于稳定推理的细粒度采样配置。非常适合需要深思熟虑、多步骤推理或形式化推导的用例。',
203
+ displayName: 'GLM Z1 32B (Free)',
204
+ id: 'thudm/glm-z1-32b:free',
205
+ type: 'chat',
206
+ },
207
+ {
208
+ abilities: {
209
+ reasoning: true,
210
+ },
211
+ contextWindowTokens: 32_000,
212
+ description:
213
+ 'GLM-Z1-32B-0414 是 GLM-4-32B 的增强推理变体,专为深度数学、逻辑和面向代码的问题解决而构建。它应用扩展强化学习(任务特定和基于通用成对偏好)来提高复杂多步骤任务的性能。与基础 GLM-4-32B 模型相比,Z1 显著提升了结构化推理和形式化领域的能力。\n\n该模型支持通过提示工程强制执行“思考”步骤,并为长格式输出提供改进的连贯性。它针对代理工作流进行了优化,并支持长上下文(通过 YaRN)、JSON 工具调用和用于稳定推理的细粒度采样配置。非常适合需要深思熟虑、多步骤推理或形式化推导的用例。',
214
+ displayName: 'GLM Z1 32B',
215
+ id: 'thudm/glm-z1-32b',
216
+ pricing: {
217
+ input: 0.24,
218
+ output: 0.24,
219
+ },
220
+ type: 'chat',
221
+ },
222
+ {
223
+ abilities: {
224
+ reasoning: true,
225
+ },
226
+ contextWindowTokens: 32_768,
227
+ description:
228
+ 'GLM-4-32B-0414 是一个 32B 双语(中英)开放权重语言模型,针对代码生成、函数调用和代理式任务进行了优化。它在 15T 高质量和重推理数据上进行了预训练,并使用人类偏好对齐、拒绝采样和强化学习进一步完善。该模型在复杂推理、工件生成和结构化输出任务方面表现出色,在多个基准测试中达到了与 GPT-4o 和 DeepSeek-V3-0324 相当的性能。',
229
+ displayName: 'GLM 4 32B (Free)',
230
+ id: 'thudm/glm-4-32b:free',
231
+ type: 'chat',
232
+ },
233
+ {
234
+ abilities: {
235
+ reasoning: true,
236
+ },
237
+ contextWindowTokens: 32_000,
238
+ description:
239
+ 'GLM-4-32B-0414 是一个 32B 双语(中英)开放权重语言模型,针对代码生成、函数调用和代理式任务进行了优化。它在 15T 高质量和重推理数据上进行了预训练,并使用人类偏好对齐、拒绝采样和强化学习进一步完善。该模型在复杂推理、工件生成和结构化输出任务方面表现出色,在多个基准测试中达到了与 GPT-4o 和 DeepSeek-V3-0324 相当的性能。',
240
+ displayName: 'GLM 4 32B',
241
+ id: 'thudm/glm-4-32b',
242
+ pricing: {
243
+ input: 0.24,
244
+ output: 0.24,
245
+ },
246
+ type: 'chat',
247
+ },
248
+ {
249
+ abilities: {
250
+ functionCall: true,
251
+ reasoning: true,
252
+ vision: true,
253
+ },
254
+ contextWindowTokens: 1_048_576,
255
+ description:
256
+ 'Gemini 2.5 Flash 是 Google 最先进的主力模型,专为高级推理、编码、数学和科学任务而设计。它包含内置的“思考”能力,使其能够提供具有更高准确性和细致上下文处理的响应。\n\n注意:此模型有两个变体:思考和非思考。输出定价根据思考能力是否激活而有显著差异。如果您选择标准变体(不带“:thinking”后缀),模型将明确避免生成思考令牌。\n\n要利用思考能力并接收思考令牌,您必须选择“:thinking”变体,这将产生更高的思考输出定价。\n\n此外,Gemini 2.5 Flash 可通过“推理最大令牌数”参数进行配置,如文档中所述 (https://openrouter.ai/docs/use-cases/reasoning-tokens#max-tokens-for-reasoning)。',
257
+ displayName: 'Gemini 2.5 Flash Preview',
258
+ id: 'google/gemini-2.5-flash-preview',
259
+ maxOutput: 65_535,
260
+ pricing: {
261
+ input: 0.15,
262
+ output: 0.6,
263
+ },
264
+ type: 'chat',
265
+ },
266
+ {
267
+ abilities: {
268
+ functionCall: true,
269
+ reasoning: true,
270
+ vision: true,
271
+ },
272
+ contextWindowTokens: 1_048_576,
273
+ description:
274
+ 'Gemini 2.5 Flash 是 Google 最先进的主力模型,专为高级推理、编码、数学和科学任务而设计。它包含内置的“思考”能力,使其能够提供具有更高准确性和细致上下文处理的响应。\n\n注意:此模型有两个变体:思考和非思考。输出定价根据思考能力是否激活而有显著差异。如果您选择标准变体(不带“:thinking”后缀),模型将明确避免生成思考令牌。\n\n要利用思考能力并接收思考令牌,您必须选择“:thinking”变体,这将产生更高的思考输出定价。\n\n此外,Gemini 2.5 Flash 可通过“推理最大令牌数”参数进行配置,如文档中所述 (https://openrouter.ai/docs/use-cases/reasoning-tokens#max-tokens-for-reasoning)。',
275
+ displayName: 'Gemini 2.5 Flash Preview (thinking)',
276
+ id: 'google/gemini-2.5-flash-preview:thinking',
277
+ maxOutput: 65_535,
278
+ pricing: {
279
+ input: 0.15,
280
+ output: 3.5,
281
+ },
282
+ type: 'chat',
283
+ },
189
284
  {
190
285
  abilities: {
191
286
  functionCall: true,
@@ -403,6 +498,27 @@ const openrouterChatModels: AIChatModelCard[] = [
403
498
  },
404
499
  type: 'chat',
405
500
  },
501
+ {
502
+ contextWindowTokens: 163_840,
503
+ description:
504
+ 'DeepSeek V3 是一个 685B 参数的专家混合模型,是 DeepSeek 团队旗舰聊天模型系列的最新迭代。\n\n它继承了 [DeepSeek V3](/deepseek/deepseek-chat-v3) 模型,并在各种任务上表现出色。',
505
+ displayName: 'DeepSeek V3 0324 (Free)',
506
+ id: 'deepseek/deepseek-chat-v3-0324:free',
507
+ type: 'chat',
508
+ },
509
+ {
510
+ contextWindowTokens: 64_000,
511
+ description:
512
+ 'DeepSeek V3 是一个 685B 参数的专家混合模型,是 DeepSeek 团队旗舰聊天模型系列的最新迭代。\n\n它继承了 [DeepSeek V3](/deepseek/deepseek-chat-v3) 模型,并在各种任务上表现出色。',
513
+ displayName: 'DeepSeek V3 0324',
514
+ id: 'deepseek/deepseek-chat-v3-0324',
515
+ pricing: {
516
+ cachedInput: 0.07,
517
+ input: 0.27,
518
+ output: 1.1,
519
+ },
520
+ type: 'chat',
521
+ },
406
522
  {
407
523
  abilities: {
408
524
  functionCall: true,
@@ -683,13 +799,13 @@ const openrouterChatModels: AIChatModelCard[] = [
683
799
  functionCall: true,
684
800
  vision: true,
685
801
  },
686
- contextWindowTokens: 2_097_152 + 8192,
802
+ contextWindowTokens: 1_048_576 + 8192,
687
803
  description:
688
- 'Gemini 2.0 Pro Experimental 是 Google 最新的实验性多模态AI模型,与历史版本相比有一定的质量提升,特别是对于世界知识、代码和长上下文。',
689
- displayName: 'Gemini 2.0 Pro Experimental 02-05 (Free)',
690
- id: 'google/gemini-2.0-pro-exp-02-05:free',
804
+ 'Gemini 2.0 Flash Experimental 是 Google 最新的实验性多模态AI模型,与历史版本相比有一定的质量提升,特别是对于世界知识、代码和长上下文。',
805
+ displayName: 'Gemini 2.0 Flash Experimental (Free)',
806
+ id: 'google/gemini-2.0-flash-exp:free',
691
807
  maxOutput: 8192,
692
- releasedAt: '2025-02-05',
808
+ releasedAt: '2024-12-11',
693
809
  type: 'chat',
694
810
  },
695
811
  ];