@lobehub/lobehub 2.0.0-next.103 → 2.0.0-next.105

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 (49) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/apps/desktop/package.json +2 -2
  3. package/changelog/v1.json +14 -0
  4. package/locales/ar/file.json +2 -2
  5. package/locales/bg-BG/file.json +2 -2
  6. package/locales/de-DE/file.json +2 -2
  7. package/locales/en-US/file.json +2 -2
  8. package/locales/es-ES/file.json +2 -2
  9. package/locales/fa-IR/file.json +2 -2
  10. package/locales/fr-FR/file.json +2 -2
  11. package/locales/it-IT/file.json +2 -2
  12. package/locales/ja-JP/file.json +2 -2
  13. package/locales/ko-KR/file.json +2 -2
  14. package/locales/nl-NL/file.json +2 -2
  15. package/locales/pl-PL/file.json +2 -2
  16. package/locales/pt-BR/file.json +2 -2
  17. package/locales/ru-RU/file.json +2 -2
  18. package/locales/tr-TR/file.json +2 -2
  19. package/locales/vi-VN/file.json +2 -2
  20. package/locales/zh-CN/file.json +2 -2
  21. package/locales/zh-TW/file.json +2 -2
  22. package/package.json +9 -3
  23. package/packages/database/src/repositories/knowledge/index.ts +5 -8
  24. package/packages/model-bank/src/aiModels/moonshot.ts +46 -0
  25. package/packages/model-runtime/src/core/contextBuilders/openai.ts +1 -1
  26. package/packages/model-runtime/src/providers/moonshot/index.ts +17 -4
  27. package/packages/types/src/user/settings/keyVaults.ts +0 -68
  28. package/packages/utils/src/client/parserPlaceholder.ts +1 -1
  29. package/src/services/__tests__/_auth.test.ts +1 -4
  30. package/src/services/_auth.ts +2 -3
  31. package/src/services/_header.ts +1 -8
  32. package/src/store/chat/agents/__tests__/createAgentExecutors/call-llm.test.ts +18 -0
  33. package/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts +40 -11
  34. package/src/store/chat/agents/__tests__/createAgentExecutors/helpers/assertions.ts +3 -0
  35. package/src/store/chat/agents/__tests__/createAgentExecutors/request-human-approve.test.ts +15 -0
  36. package/src/store/chat/agents/__tests__/createAgentExecutors/resolve-aborted-tools.test.ts +37 -11
  37. package/src/store/chat/agents/createAgentExecutors.ts +22 -13
  38. package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +4 -8
  39. package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +16 -2
  40. package/src/store/chat/slices/builtinTool/actions/localSystem.ts +5 -1
  41. package/src/store/chat/slices/builtinTool/actions/search.ts +5 -1
  42. package/src/store/chat/slices/message/actions/publicApi.ts +10 -2
  43. package/src/store/chat/slices/message/actions/query.ts +17 -4
  44. package/src/store/chat/slices/operation/__tests__/selectors.test.ts +93 -5
  45. package/src/store/chat/slices/operation/selectors.ts +16 -3
  46. package/src/store/chat/slices/plugin/actions/optimisticUpdate.ts +24 -18
  47. package/src/store/user/slices/settings/selectors/keyVaults.ts +0 -5
  48. package/src/features/ChatList/Error/AccessCodeForm.tsx +0 -63
  49. package/src/services/__tests__/share.test.ts +0 -61
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.105](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.104...v2.0.0-next.105)
6
+
7
+ <sup>Released on **2025-11-23**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **operation**: Isolate loading state to current active topic.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **operation**: Isolate loading state to current active topic, closes [#10360](https://github.com/lobehub/lobe-chat/issues/10360) ([c568369](https://github.com/lobehub/lobe-chat/commit/c568369))
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.104](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.103...v2.0.0-next.104)
31
+
32
+ <sup>Released on **2025-11-22**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Update i18n.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Update i18n, closes [#10349](https://github.com/lobehub/lobe-chat/issues/10349) ([3482d38](https://github.com/lobehub/lobe-chat/commit/3482d38))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ## [Version 2.0.0-next.103](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.102...v2.0.0-next.103)
6
56
 
7
57
  <sup>Released on **2025-11-22**</sup>
@@ -58,7 +58,7 @@
58
58
  "electron-is": "^3.0.0",
59
59
  "electron-log": "^5.4.3",
60
60
  "electron-store": "^8.2.0",
61
- "electron-vite": "^3.1.0",
61
+ "electron-vite": "^4.0.1",
62
62
  "execa": "^9.6.0",
63
63
  "fast-glob": "^3.3.3",
64
64
  "fix-path": "^5.0.0",
@@ -73,7 +73,7 @@
73
73
  "tsx": "^4.20.6",
74
74
  "typescript": "^5.9.3",
75
75
  "undici": "^7.16.0",
76
- "vite": "^6.4.1",
76
+ "vite": "^7.2.4",
77
77
  "vitest": "^3.2.4"
78
78
  },
79
79
  "pnpm": {
package/changelog/v1.json CHANGED
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "children": {},
4
+ "date": "2025-11-23",
5
+ "version": "2.0.0-next.105"
6
+ },
7
+ {
8
+ "children": {
9
+ "improvements": [
10
+ "Update i18n."
11
+ ]
12
+ },
13
+ "date": "2025-11-22",
14
+ "version": "2.0.0-next.104"
15
+ },
2
16
  {
3
17
  "children": {
4
18
  "fixes": [
@@ -116,8 +116,8 @@
116
116
  "title": "المكتبة المعرفية"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "جميع المستندات",
120
- "allFiles": "جميع الملفات"
119
+ "allFiles": "جميع الملفات",
120
+ "allPages": "جميع المستندات"
121
121
  },
122
122
  "networkError": "فشل في الحصول على قاعدة المعرفة، يرجى التحقق من اتصال الشبكة ثم إعادة المحاولة",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "База знания"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Всички документи",
120
- "allFiles": "Всички файлове"
119
+ "allFiles": "Всички файлове",
120
+ "allPages": "Всички документи"
121
121
  },
122
122
  "networkError": "Неуспешно получаване на базата от знания, моля, проверете интернет връзката и опитайте отново",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Wissensdatenbank"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Alle Dokumente",
120
- "allFiles": "Alle Dateien"
119
+ "allFiles": "Alle Dateien",
120
+ "allPages": "Alle Dokumente"
121
121
  },
122
122
  "networkError": "Fehler beim Abrufen der Wissensdatenbank. Bitte überprüfen Sie Ihre Netzwerkverbindung und versuchen Sie es erneut.",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Knowledge Base"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "All Documents",
120
- "allFiles": "All Files"
119
+ "allFiles": "All Files",
120
+ "allPages": "All Documents"
121
121
  },
122
122
  "networkError": "Failed to retrieve the knowledge base. Please check your network connection and try again.",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Base de conocimientos"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Todos los documentos",
120
- "allFiles": "Todos los archivos"
119
+ "allFiles": "Todos los archivos",
120
+ "allPages": "Todos los documentos"
121
121
  },
122
122
  "networkError": "Error al obtener la base de conocimientos, por favor verifica la conexión a internet y vuelve a intentarlo",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "پایگاه دانش"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "همه اسناد",
120
- "allFiles": "تمام فایل‌ها"
119
+ "allFiles": "تمام فایل‌ها",
120
+ "allPages": "همهٔ نوشته‌ها"
121
121
  },
122
122
  "networkError": "دریافت مخزن دانش ناموفق بود، لطفاً پس از بررسی اتصال شبکه دوباره تلاش کنید.",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Base de connaissances"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Tous les documents",
120
- "allFiles": "Tous les fichiers"
119
+ "allFiles": "Tous les fichiers",
120
+ "allPages": "Tous les documents"
121
121
  },
122
122
  "networkError": "Échec de l'accès à la base de connaissances, veuillez vérifier votre connexion réseau et réessayer",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Knowledge Base"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Tutti i documenti",
120
- "allFiles": "Tutti i file"
119
+ "allFiles": "Tutti i file",
120
+ "allPages": "Tutti i documenti"
121
121
  },
122
122
  "networkError": "Impossibile ottenere la knowledge base, controlla la connessione di rete e riprova",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "知識ベース"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "すべてのドキュメント",
120
- "allFiles": "すべてのファイル"
119
+ "allFiles": "すべてのファイル",
120
+ "allPages": "すべてのドキュメント"
121
121
  },
122
122
  "networkError": "知識ベースの取得に失敗しました。ネットワーク接続を確認してから再試行してください",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "지식베이스"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "모든 문서",
120
- "allFiles": "모든 파일"
119
+ "allFiles": "모든 파일",
120
+ "allPages": "모든 문서"
121
121
  },
122
122
  "networkError": "지식베이스를 불러오지 못했습니다. 네트워크 연결을 확인한 후 다시 시도해 주세요",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Kennisbank"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Alle documenten",
120
- "allFiles": "Alle bestanden"
119
+ "allFiles": "Alle bestanden",
120
+ "allPages": "Alle documenten"
121
121
  },
122
122
  "networkError": "Kon de kennisbank niet ophalen, controleer uw netwerkverbinding en probeer het opnieuw",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Baza wiedzy"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Wszystkie dokumenty",
120
- "allFiles": "Wszystkie pliki"
119
+ "allFiles": "Wszystkie pliki",
120
+ "allPages": "Wszystkie dokumenty"
121
121
  },
122
122
  "networkError": "Nie udało się uzyskać dostępu do bazy wiedzy, proszę sprawdzić połączenie sieciowe i spróbować ponownie",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Repositório de conhecimento"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Todos os Documentos",
120
- "allFiles": "Todos os arquivos"
119
+ "allFiles": "Todos os arquivos",
120
+ "allPages": "Todos os Documentos"
121
121
  },
122
122
  "networkError": "Falha ao acessar a base de conhecimento, por favor verifique a conexão de rede e tente novamente",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "База знаний"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Все документы",
120
- "allFiles": "Все файлы"
119
+ "allFiles": "Все файлы",
120
+ "allPages": "Все документы"
121
121
  },
122
122
  "networkError": "Не удалось получить базу знаний, пожалуйста, проверьте сетевое соединение и попробуйте снова",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Bilgi Tabanı"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Tüm Belgeler",
120
- "allFiles": "Tüm Dosyalar"
119
+ "allFiles": "Tüm Dosyalar",
120
+ "allPages": "Tüm Belgeler"
121
121
  },
122
122
  "networkError": "Bilgi bankası alınamadı, lütfen ağ bağlantınızı kontrol edip tekrar deneyin",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "Kho tri thức"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "Tất cả tài liệu",
120
- "allFiles": "Tất cả tệp"
119
+ "allFiles": "Tất cả tệp",
120
+ "allPages": "Tất cả tài liệu"
121
121
  },
122
122
  "networkError": "Không thể lấy kho tri thức, vui lòng kiểm tra kết nối mạng và thử lại",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "知识库"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "全部文档",
120
- "allFiles": "全部文件"
119
+ "allFiles": "全部文件",
120
+ "allPages": "全部文稿"
121
121
  },
122
122
  "networkError": "获取知识库失败,请检测网络连接后重试",
123
123
  "notSupportGuide": {
@@ -116,8 +116,8 @@
116
116
  "title": "知識庫"
117
117
  },
118
118
  "menu": {
119
- "allDocuments": "全部文件",
120
- "allFiles": "所有檔案"
119
+ "allFiles": "所有檔案",
120
+ "allPages": "全部文件"
121
121
  },
122
122
  "networkError": "獲取知識庫失敗,請檢查網路連接後重試",
123
123
  "notSupportGuide": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.103",
3
+ "version": "2.0.0-next.105",
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",
@@ -123,6 +123,9 @@
123
123
  "eslint --fix"
124
124
  ]
125
125
  },
126
+ "overrides": {
127
+ "stylelint-config-clean-order": "7.0.0"
128
+ },
126
129
  "dependencies": {
127
130
  "@ant-design/icons": "^5.6.1",
128
131
  "@ant-design/pro-components": "^2.8.10",
@@ -295,7 +298,7 @@
295
298
  "unstructured-client": "^0.19.0",
296
299
  "url-join": "^5.0.0",
297
300
  "use-merge-value": "^1.2.0",
298
- "uuid": "^11.1.0",
301
+ "uuid": "^13.0.0",
299
302
  "virtua": "^0.47.0",
300
303
  "word-extractor": "^1.0.4",
301
304
  "ws": "^8.18.3",
@@ -399,6 +402,9 @@
399
402
  "pnpm": {
400
403
  "onlyBuiltDependencies": [
401
404
  "@vercel/speed-insights"
402
- ]
405
+ ],
406
+ "overrides": {
407
+ "stylelint-config-clean-order": "7.0.0"
408
+ }
403
409
  }
404
410
  }
@@ -129,12 +129,6 @@ export class KnowledgeRepo {
129
129
  };
130
130
  });
131
131
 
132
- console.log('[KnowledgeRepo.query] Fetched items:', {
133
- count: mappedResults.length,
134
- documents: mappedResults.filter((item) => item.sourceType === 'document'),
135
- sampleEditorData: mappedResults.find((item) => item.sourceType === 'document')?.editorData,
136
- });
137
-
138
132
  return mappedResults;
139
133
  }
140
134
 
@@ -308,7 +302,10 @@ export class KnowledgeRepo {
308
302
 
309
303
  // Exclude custom/document and source_type='file' from Documents category
310
304
  if (category === FilesTabs.Documents) {
311
- whereConditions.push(sql`${documents.fileType} != ${'custom/document'}`, sql`${documents.sourceType} != ${'file'}`);
305
+ whereConditions.push(
306
+ sql`${documents.fileType} != ${'custom/document'}`,
307
+ sql`${documents.sourceType} != ${'file'}`,
308
+ );
312
309
  }
313
310
  } else if (fileTypePrefix) {
314
311
  whereConditions.push(sql`${documents.fileType} ILIKE ${`${fileTypePrefix}%`}`);
@@ -338,7 +335,7 @@ export class KnowledgeRepo {
338
335
  // Documents don't have knowledge base association currently, so skip if knowledgeBaseId is set
339
336
  if (knowledgeBaseId) {
340
337
  return sql`
341
- SELECT
338
+ SELECT
342
339
  NULL::varchar(30) as id,
343
340
  NULL::text as name,
344
341
  NULL::varchar(255) as file_type,
@@ -2,6 +2,52 @@ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://platform.moonshot.cn/docs/pricing/chat
4
4
  const moonshotChatModels: AIChatModelCard[] = [
5
+ {
6
+ abilities: {
7
+ functionCall: true,
8
+ reasoning: true,
9
+ structuredOutput: true,
10
+ },
11
+ contextWindowTokens: 262_144,
12
+ description: 'K2 长思考模型,支持 256k 上下文,支持多步工具调用与思考,擅长解决更复杂的问题。',
13
+ displayName: 'Kimi K2 Thinking',
14
+ enabled: true,
15
+ id: 'kimi-k2-thinking',
16
+ maxOutput: 65_536,
17
+ pricing: {
18
+ currency: 'CNY',
19
+ units: [
20
+ { name: 'textInput_cacheRead', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
21
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
22
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
23
+ ],
24
+ },
25
+ releasedAt: '2025-11-06',
26
+ type: 'chat',
27
+ },
28
+ {
29
+ abilities: {
30
+ functionCall: true,
31
+ reasoning: true,
32
+ structuredOutput: true,
33
+ },
34
+ contextWindowTokens: 262_144,
35
+ description:
36
+ 'K2 长思考模型的高速版本,支持 256k 上下文,擅长深度推理,输出速度提升至每秒 60-100 tokens 。',
37
+ displayName: 'Kimi K2 Thinking Turbo',
38
+ id: 'kimi-k2-thinking-turbo',
39
+ maxOutput: 65_536,
40
+ pricing: {
41
+ currency: 'CNY',
42
+ units: [
43
+ { name: 'textInput_cacheRead', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
44
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
45
+ { name: 'textOutput', rate: 58, strategy: 'fixed', unit: 'millionTokens' },
46
+ ],
47
+ },
48
+ releasedAt: '2025-11-06',
49
+ type: 'chat',
50
+ },
5
51
  {
6
52
  abilities: {
7
53
  functionCall: true,
@@ -49,7 +49,7 @@ export const convertOpenAIMessages = async (messages: OpenAI.ChatCompletionMessa
49
49
  if (msg.tool_call_id !== undefined) result.tool_call_id = msg.tool_call_id;
50
50
  if (msg.function_call !== undefined) result.function_call = msg.function_call;
51
51
 
52
- // it's compatible for DeepSeek
52
+ // it's compatible for DeepSeek & Moonshot
53
53
  if (msg.reasoning_content !== undefined) result.reasoning_content = msg.reasoning_content;
54
54
  // MiniMax uses reasoning_details for historical thinking, so forward it unchanged
55
55
  if (msg.reasoning_details !== undefined) result.reasoning_details = msg.reasoning_details;
@@ -18,12 +18,25 @@ export const params = {
18
18
  handlePayload: (payload: ChatStreamPayload) => {
19
19
  const { enabledSearch, messages, temperature, tools, ...rest } = payload;
20
20
 
21
- // assistant 空消息添加一个空格 (#8418)
22
- const filteredMessages = messages.map((message) => {
21
+ const filteredMessages = messages.map((message: any) => {
22
+ let normalizedMessage = message;
23
+
24
+ // 为 assistant 空消息添加一个空格 (#8418)
23
25
  if (message.role === 'assistant' && (!message.content || message.content === '')) {
24
- return { ...message, content: ' ' };
26
+ normalizedMessage = { ...normalizedMessage, content: ' ' };
27
+ }
28
+
29
+ // Interleaved thinking
30
+ if (message.role === 'assistant' && message.reasoning) {
31
+ const { reasoning, ...messageWithoutReasoning } = normalizedMessage;
32
+ return {
33
+ ...messageWithoutReasoning,
34
+ ...(!reasoning.signature && reasoning.content
35
+ ? { reasoning_content: reasoning.content }
36
+ : {}),
37
+ };
25
38
  }
26
- return message;
39
+ return normalizedMessage;
27
40
  });
28
41
 
29
42
  const moonshotTools = enabledSearch
@@ -51,73 +51,5 @@ export interface SearchEngineKeyVaults {
51
51
  }
52
52
 
53
53
  export interface UserKeyVaults extends SearchEngineKeyVaults {
54
- ai21?: OpenAICompatibleKeyVault;
55
- ai302?: OpenAICompatibleKeyVault;
56
- ai360?: OpenAICompatibleKeyVault;
57
- aihubmix?: OpenAICompatibleKeyVault;
58
- akashchat?: OpenAICompatibleKeyVault;
59
- anthropic?: OpenAICompatibleKeyVault;
60
- azure?: AzureOpenAIKeyVault;
61
- azureai?: AzureOpenAIKeyVault;
62
- baichuan?: OpenAICompatibleKeyVault;
63
- bedrock?: AWSBedrockKeyVault;
64
- bfl?: any;
65
- cerebras?: OpenAICompatibleKeyVault;
66
- cloudflare?: CloudflareKeyVault;
67
- cohere?: OpenAICompatibleKeyVault;
68
- cometapi?: OpenAICompatibleKeyVault;
69
- comfyui?: ComfyUIKeyVault;
70
- deepseek?: OpenAICompatibleKeyVault;
71
- fal?: FalKeyVault;
72
- fireworksai?: OpenAICompatibleKeyVault;
73
- giteeai?: OpenAICompatibleKeyVault;
74
- github?: OpenAICompatibleKeyVault;
75
- google?: OpenAICompatibleKeyVault;
76
- groq?: OpenAICompatibleKeyVault;
77
- higress?: OpenAICompatibleKeyVault;
78
- huggingface?: OpenAICompatibleKeyVault;
79
- hunyuan?: OpenAICompatibleKeyVault;
80
- infiniai?: OpenAICompatibleKeyVault;
81
- internlm?: OpenAICompatibleKeyVault;
82
- jina?: OpenAICompatibleKeyVault;
83
- lmstudio?: OpenAICompatibleKeyVault;
84
- lobehub?: any;
85
- minimax?: OpenAICompatibleKeyVault;
86
- mistral?: OpenAICompatibleKeyVault;
87
- modelscope?: OpenAICompatibleKeyVault;
88
- moonshot?: OpenAICompatibleKeyVault;
89
- nebius?: OpenAICompatibleKeyVault;
90
- newapi?: OpenAICompatibleKeyVault;
91
- novita?: OpenAICompatibleKeyVault;
92
- nvidia?: OpenAICompatibleKeyVault;
93
- ollama?: OpenAICompatibleKeyVault;
94
- ollamacloud?: OpenAICompatibleKeyVault;
95
- openai?: OpenAICompatibleKeyVault;
96
- openrouter?: OpenAICompatibleKeyVault;
97
- password?: string;
98
- perplexity?: OpenAICompatibleKeyVault;
99
- ppio?: OpenAICompatibleKeyVault;
100
- qiniu?: OpenAICompatibleKeyVault;
101
- qwen?: OpenAICompatibleKeyVault;
102
- sambanova?: OpenAICompatibleKeyVault;
103
54
  search1api?: OpenAICompatibleKeyVault;
104
- sensenova?: OpenAICompatibleKeyVault;
105
- siliconcloud?: OpenAICompatibleKeyVault;
106
- spark?: OpenAICompatibleKeyVault;
107
- stepfun?: OpenAICompatibleKeyVault;
108
- taichu?: OpenAICompatibleKeyVault;
109
- tencentcloud?: OpenAICompatibleKeyVault;
110
- togetherai?: OpenAICompatibleKeyVault;
111
- upstage?: OpenAICompatibleKeyVault;
112
- v0?: OpenAICompatibleKeyVault;
113
- vercelaigateway?: OpenAICompatibleKeyVault;
114
- vertexai?: VertexAIKeyVault;
115
- vllm?: OpenAICompatibleKeyVault;
116
- volcengine?: OpenAICompatibleKeyVault;
117
- wenxin?: OpenAICompatibleKeyVault;
118
- xai?: OpenAICompatibleKeyVault;
119
- xinference?: OpenAICompatibleKeyVault;
120
- zenmux?: OpenAICompatibleKeyVault;
121
- zeroone?: OpenAICompatibleKeyVault;
122
- zhipu?: OpenAICompatibleKeyVault;
123
55
  }
@@ -87,7 +87,7 @@ export const VARIABLE_GENERATORS = {
87
87
  random_digit: () => Math.floor(Math.random() * 10).toString(),
88
88
 
89
89
  /**
90
- * UUID 类模板变量
90
+ * UUID-type template variables
91
91
  *
92
92
  * | Value | Example |
93
93
  * |-------|---------|
@@ -23,10 +23,7 @@ const mockTogetherAIAPIKey = 'togetherai-api-key';
23
23
  // mock the traditional zustand
24
24
  vi.mock('zustand/traditional');
25
25
 
26
- const setModelProviderConfig = <T extends GlobalLLMProviderKey>(
27
- provider: T,
28
- config: Partial<UserKeyVaults[T]>,
29
- ) => {
26
+ const setModelProviderConfig = (provider: string, config: any) => {
30
27
  useUserStore.setState({
31
28
  settings: { keyVaults: { [provider]: config } },
32
29
  });
@@ -13,7 +13,7 @@ import { ModelProvider } from 'model-bank';
13
13
 
14
14
  import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
15
15
  import { useUserStore } from '@/store/user';
16
- import { keyVaultsConfigSelectors, userProfileSelectors } from '@/store/user/selectors';
16
+ import { userProfileSelectors } from '@/store/user/selectors';
17
17
  import { obfuscatePayloadWithXOR } from '@/utils/client/xor-obfuscation';
18
18
 
19
19
  import { resolveRuntimeProvider } from './chat/helper';
@@ -105,10 +105,9 @@ export const getProviderAuthPayload = (
105
105
  };
106
106
 
107
107
  const createAuthTokenWithPayload = (payload = {}) => {
108
- const accessCode = keyVaultsConfigSelectors.password(useUserStore.getState());
109
108
  const userId = userProfileSelectors.userId(useUserStore.getState());
110
109
 
111
- return obfuscatePayloadWithXOR<ClientSecretPayload>({ accessCode, userId, ...payload });
110
+ return obfuscatePayloadWithXOR<ClientSecretPayload>({ userId, ...payload });
112
111
  };
113
112
 
114
113
  interface AuthParams {
@@ -1,12 +1,6 @@
1
- import {
2
- LOBE_CHAT_ACCESS_CODE,
3
- LOBE_USER_ID,
4
- OPENAI_API_KEY_HEADER_KEY,
5
- OPENAI_END_POINT,
6
- } from '@/const/fetch';
1
+ import { LOBE_USER_ID, OPENAI_API_KEY_HEADER_KEY, OPENAI_END_POINT } from '@/const/fetch';
7
2
  import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
8
3
  import { useUserStore } from '@/store/user';
9
- import { keyVaultsConfigSelectors } from '@/store/user/selectors';
10
4
 
11
5
  /**
12
6
  * TODO: Need to be removed after tts refactor
@@ -22,7 +16,6 @@ export const createHeaderWithOpenAI = (header?: HeadersInit): HeadersInit => {
22
16
  // eslint-disable-next-line no-undef
23
17
  return {
24
18
  ...header,
25
- [LOBE_CHAT_ACCESS_CODE]: keyVaultsConfigSelectors.password(state),
26
19
  [LOBE_USER_ID]: state.user?.id || '',
27
20
  [OPENAI_API_KEY_HEADER_KEY]: keyVaults.apiKey || '',
28
21
  [OPENAI_END_POINT]: keyVaults.baseURL || '',