@lobehub/lobehub 2.0.0-next.62 → 2.0.0-next.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/locales/ar/plugin.json +2 -0
- package/locales/bg-BG/plugin.json +2 -0
- package/locales/de-DE/plugin.json +2 -0
- package/locales/en-US/plugin.json +8 -1
- package/locales/es-ES/plugin.json +2 -0
- package/locales/fa-IR/plugin.json +2 -0
- package/locales/fr-FR/plugin.json +2 -0
- package/locales/it-IT/plugin.json +2 -0
- package/locales/ja-JP/plugin.json +2 -0
- package/locales/ko-KR/plugin.json +2 -0
- package/locales/nl-NL/plugin.json +2 -0
- package/locales/pl-PL/plugin.json +2 -0
- package/locales/pt-BR/plugin.json +2 -0
- package/locales/ru-RU/plugin.json +2 -0
- package/locales/tr-TR/plugin.json +2 -0
- package/locales/vi-VN/plugin.json +2 -0
- package/locales/zh-CN/plugin.json +8 -1
- package/locales/zh-TW/plugin.json +2 -0
- package/package.json +1 -2
- package/packages/agent-runtime/src/types/event.ts +2 -1
- package/packages/conversation-flow/src/transformation/__tests__/MessageTransformer.test.ts +1 -2
- package/packages/database/src/client/db.test.ts +1 -2
- package/packages/database/src/client/db.ts +6 -6
- package/packages/database/src/core/electron.ts +1 -1
- package/packages/database/src/models/__tests__/asyncTask.test.ts +1 -2
- package/packages/database/src/models/__tests__/file.test.ts +1 -2
- package/packages/database/src/models/__tests__/generation.test.ts +1 -2
- package/packages/database/src/models/__tests__/generationBatch.test.ts +1 -2
- package/packages/database/src/models/aiProvider.ts +7 -7
- package/packages/database/src/repositories/aiInfra/index.test.ts +6 -6
- package/packages/database/src/repositories/aiInfra/index.ts +7 -7
- package/packages/database/src/repositories/dataImporter/__tests__/index.test.ts +1 -2
- package/packages/database/src/repositories/dataImporter/deprecated/__tests__/index.test.ts +1 -1
- package/packages/database/src/repositories/dataImporter/deprecated/index.ts +1 -1
- package/packages/database/src/repositories/dataImporter/index.ts +1 -2
- package/packages/database/src/repositories/tableViewer/index.ts +4 -5
- package/packages/database/src/schemas/agent.ts +1 -2
- package/packages/database/src/schemas/aiInfra.ts +1 -2
- package/packages/database/src/schemas/document.ts +1 -2
- package/packages/database/src/schemas/file.ts +1 -2
- package/packages/database/src/schemas/topic.ts +1 -2
- package/packages/database/src/schemas/user.ts +1 -1
- package/packages/database/src/server/models/__tests__/user.test.ts +1 -1
- package/packages/model-runtime/src/core/streams/vertex-ai.ts +1 -2
- package/packages/model-runtime/src/providers/comfyui/__tests__/index.test.ts +1 -2
- package/packages/model-runtime/src/providers/comfyui/auth/AuthManager.ts +1 -2
- package/packages/model-runtime/src/providers/comfyui/index.ts +2 -7
- package/packages/types/src/files/list.ts +1 -1
- package/packages/types/src/files/upload.ts +1 -1
- package/packages/types/src/importer.ts +2 -2
- package/packages/types/src/index.ts +4 -0
- package/packages/types/src/openai/image.ts +1 -1
- package/packages/types/src/topic/topic.ts +1 -1
- package/packages/types/src/user/settings/hotkey.ts +1 -1
- package/src/components/FileIcon/index.tsx +0 -2
- package/src/features/Conversation/Messages/Assistant/MessageContent.tsx +0 -18
- package/src/features/Conversation/Messages/Group/Tool/Inspector/index.tsx +26 -5
- package/src/features/Conversation/Messages/Group/Tool/index.tsx +1 -1
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/ToolTitle.tsx +1 -7
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/index.tsx +2 -15
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/CustomRender.tsx +1 -1
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/PluginSettings.tsx +2 -2
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/index.tsx +2 -31
- package/src/features/Conversation/Messages/Tool/ToolItem.tsx +51 -0
- package/src/features/Conversation/Messages/Tool/index.tsx +58 -0
- package/src/features/Conversation/Messages/index.tsx +5 -0
- package/src/features/DataImporter/index.tsx +2 -2
- package/src/features/ShareModal/ShareJSON/index.tsx +2 -2
- package/src/locales/default/plugin.ts +8 -0
- package/src/store/chat/slices/message/action.test.ts +8 -4
- package/src/store/chat/slices/message/actions/optimisticUpdate.ts +12 -0
- package/src/store/chat/slices/message/actions/publicApi.ts +19 -17
- package/src/tools/local-system/index.ts +27 -27
- package/src/tools/local-system/systemRole.ts +7 -7
- package/Dockerfile.lite +0 -272
- package/src/features/Conversation/Messages/Assistant/Tool/Render/LoadingPlaceholder/index.tsx +0 -29
- package/src/features/Conversation/Messages/Assistant/Tool/index.tsx +0 -76
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/BuiltinPluginTitle.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/Debug.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginResult.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginState.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/Settings.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ObjectEntity.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ValueCell.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/index.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/ErrorResponse.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/KeyValueEditor.tsx +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.64](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.63...v2.0.0-next.64)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-11-15**</sup>
|
|
8
|
+
|
|
9
|
+
#### ♻ Code Refactoring
|
|
10
|
+
|
|
11
|
+
- **misc**: Refactor package types.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Code refactoring
|
|
19
|
+
|
|
20
|
+
- **misc**: Refactor package types, closes [#10233](https://github.com/lobehub/lobe-chat/issues/10233) ([9872409](https://github.com/lobehub/lobe-chat/commit/9872409))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 2.0.0-next.63](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.62...v2.0.0-next.63)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2025-11-15**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **misc**: Show orphaned tool message and support delete tool message.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's improved
|
|
44
|
+
|
|
45
|
+
- **misc**: Show orphaned tool message and support delete tool message, closes [#10232](https://github.com/lobehub/lobe-chat/issues/10232) ([38cfd26](https://github.com/lobehub/lobe-chat/commit/38cfd26))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 2.0.0-next.62](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.61...v2.0.0-next.62)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2025-11-15**</sup>
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {
|
|
4
|
+
"improvements": [
|
|
5
|
+
"Refactor package types."
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
"date": "2025-11-15",
|
|
9
|
+
"version": "2.0.0-next.64"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"children": {
|
|
13
|
+
"features": [
|
|
14
|
+
"Show orphaned tool message and support delete tool message."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"date": "2025-11-15",
|
|
18
|
+
"version": "2.0.0-next.63"
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"children": {},
|
|
4
22
|
"date": "2025-11-15",
|
package/locales/ar/plugin.json
CHANGED
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "عرض قائمة المعلمات",
|
|
239
|
+
"delete": "حذف استدعاء الأداة",
|
|
240
|
+
"orphanedToolCall": "قد تكون رسالة استدعاء الأداة هذه معزولة بسبب ظروف غير طبيعية، مما قد يؤثر على تنفيذ الوكيل بشكل صحيح. يُرجى إزالتها.",
|
|
239
241
|
"pluginRender": "عرض واجهة الإضافة"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Преглед на списъка с параметри",
|
|
239
|
+
"delete": "Изтриване на извикване на инструмент",
|
|
240
|
+
"orphanedToolCall": "Това извикване на инструмент може да е станало изолирано поради необичайни причини, което може да повлияе на нормалното изпълнение на агента. Моля, премахнете го.",
|
|
239
241
|
"pluginRender": "Преглед на интерфейса на плъгина"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Parameterliste anzeigen",
|
|
239
|
+
"delete": "Werkzeugaufruf löschen",
|
|
240
|
+
"orphanedToolCall": "Dieser Werkzeugaufruf könnte aufgrund eines Fehlers verwaist sein, was den normalen Ablauf des Agenten beeinträchtigen kann. Bitte entfernen Sie ihn.",
|
|
239
241
|
"pluginRender": "Plugin-Oberfläche anzeigen"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "View Argument List",
|
|
239
|
+
"delete": "Delete Tool Call",
|
|
240
|
+
"orphanedToolCall": "This tool call message may have become orphaned due to an unexpected issue, which could affect the Agent's normal operation. Please remove it.",
|
|
239
241
|
"pluginRender": "View Plugin Interface"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -251,13 +253,18 @@
|
|
|
251
253
|
},
|
|
252
254
|
"localSystem": {
|
|
253
255
|
"apiName": {
|
|
256
|
+
"getCommandOutput": "Get Code Output",
|
|
257
|
+
"globLocalFiles": "Match Files",
|
|
258
|
+
"grepContent": "Search Content",
|
|
259
|
+
"killCommand": "Kill Code Execution",
|
|
254
260
|
"listLocalFiles": "View File List",
|
|
255
261
|
"moveLocalFiles": "Move Files",
|
|
256
262
|
"readLocalFile": "Read File Content",
|
|
257
263
|
"renameLocalFile": "Rename",
|
|
258
264
|
"runCommand": "Run Code",
|
|
259
265
|
"searchLocalFiles": "Search Files",
|
|
260
|
-
"writeLocalFile": "Write File"
|
|
266
|
+
"writeLocalFile": "Write File",
|
|
267
|
+
"editLocalFile": "Edit File"
|
|
261
268
|
},
|
|
262
269
|
"title": "Local System"
|
|
263
270
|
},
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Ver lista de parámetros",
|
|
239
|
+
"delete": "Eliminar llamada a la herramienta",
|
|
240
|
+
"orphanedToolCall": "Este mensaje de llamada a la herramienta podría haberse quedado huérfano debido a circunstancias excepcionales, lo que puede afectar el funcionamiento normal del agente. Por favor, elimínelo.",
|
|
239
241
|
"pluginRender": "Ver interfaz del plugin"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "مشاهده لیست پارامترها",
|
|
239
|
+
"delete": "حذف فراخوانی ابزار",
|
|
240
|
+
"orphanedToolCall": "این پیام فراخوانی ابزار ممکن است به دلایل غیرعادی به یک پیام یتیم تبدیل شده باشد که میتواند عملکرد عادی عامل را مختل کند. لطفاً آن را حذف کنید.",
|
|
239
241
|
"pluginRender": "مشاهده رابط افزونه"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Voir la liste des paramètres",
|
|
239
|
+
"delete": "Supprimer l'appel d'outil",
|
|
240
|
+
"orphanedToolCall": "Cet appel d'outil est peut-être devenu orphelin en raison d'une erreur, ce qui pourrait perturber le bon fonctionnement de l'agent. Veuillez le supprimer.",
|
|
239
241
|
"pluginRender": "Voir l'interface du plugin"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Visualizza lista parametri",
|
|
239
|
+
"delete": "Elimina chiamata allo strumento",
|
|
240
|
+
"orphanedToolCall": "Questo messaggio di chiamata allo strumento potrebbe essere diventato orfano a causa di un'anomalia, il che potrebbe compromettere il corretto funzionamento dell'agente. Si consiglia di rimuoverlo.",
|
|
239
241
|
"pluginRender": "Visualizza interfaccia plugin"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Bekijk parameterlijst",
|
|
239
|
+
"delete": "Hulpoproep verwijderen",
|
|
240
|
+
"orphanedToolCall": "Dit hulpoproepbericht is mogelijk geïsoleerd geraakt door een onverwachte fout, wat de normale werking van de agent kan beïnvloeden. Verwijder het alstublieft.",
|
|
239
241
|
"pluginRender": "Bekijk plugin-interface"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Zobacz listę argumentów",
|
|
239
|
+
"delete": "Usuń wywołanie narzędzia",
|
|
240
|
+
"orphanedToolCall": "To wywołanie narzędzia mogło zostać osierocone z powodu nieoczekiwanych okoliczności, co może zakłócić prawidłowe działanie Agenta. Proszę je usunąć.",
|
|
239
241
|
"pluginRender": "Zobacz interfejs wtyczki"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Ver lista de parâmetros",
|
|
239
|
+
"delete": "Excluir chamada de ferramenta",
|
|
240
|
+
"orphanedToolCall": "Esta chamada de ferramenta pode ter se tornado uma mensagem órfã devido a um erro, o que pode afetar a execução normal do Agente. Por favor, remova-a.",
|
|
239
241
|
"pluginRender": "Ver interface do plugin"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Просмотр списка параметров",
|
|
239
|
+
"delete": "Удалить вызов инструмента",
|
|
240
|
+
"orphanedToolCall": "Этот вызов инструмента, возможно, стал изолированным из-за непредвиденных обстоятельств, что может повлиять на корректную работу агента. Пожалуйста, удалите его.",
|
|
239
241
|
"pluginRender": "Просмотр интерфейса плагина"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Parametre listesini görüntüle",
|
|
239
|
+
"delete": "Araç çağrısını sil",
|
|
240
|
+
"orphanedToolCall": "Bu araç çağrısı mesajı, beklenmeyen bir nedenle yetim kalmış olabilir ve bu durum Ajansın düzgün çalışmasını etkileyebilir. Lütfen bunu kaldırın.",
|
|
239
241
|
"pluginRender": "Eklenti arayüzünü görüntüle"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "Xem danh sách tham số",
|
|
239
|
+
"delete": "Xoá lệnh gọi công cụ",
|
|
240
|
+
"orphanedToolCall": "Lệnh gọi công cụ này có thể đã trở thành một tin nhắn bị cô lập do sự cố bất thường, điều này có thể ảnh hưởng đến quá trình thực thi bình thường của Tác nhân. Vui lòng xoá nó.",
|
|
239
241
|
"pluginRender": "Xem giao diện plugin"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -236,6 +236,8 @@
|
|
|
236
236
|
},
|
|
237
237
|
"inspector": {
|
|
238
238
|
"args": "查看参数列表",
|
|
239
|
+
"delete": "删除工具调用",
|
|
240
|
+
"orphanedToolCall": "该工具调用消息可能因异常原因成为孤立消息,这会影响 Agent 的正常执行,请将其移除",
|
|
239
241
|
"pluginRender": "查看插件界面"
|
|
240
242
|
},
|
|
241
243
|
"list": {
|
|
@@ -251,13 +253,18 @@
|
|
|
251
253
|
},
|
|
252
254
|
"localSystem": {
|
|
253
255
|
"apiName": {
|
|
256
|
+
"getCommandOutput": "获取代码输出",
|
|
257
|
+
"globLocalFiles": "匹配搜索文件",
|
|
258
|
+
"grepContent": "搜索内容",
|
|
259
|
+
"killCommand": "终止代码执行",
|
|
254
260
|
"listLocalFiles": "查看文件列表",
|
|
255
261
|
"moveLocalFiles": "移动文件",
|
|
256
262
|
"readLocalFile": "读取文件内容",
|
|
257
263
|
"renameLocalFile": "重命名",
|
|
258
264
|
"runCommand": "执行代码",
|
|
259
265
|
"searchLocalFiles": "搜索文件",
|
|
260
|
-
"writeLocalFile": "写入文件"
|
|
266
|
+
"writeLocalFile": "写入文件",
|
|
267
|
+
"editLocalFile": "编辑文件"
|
|
261
268
|
},
|
|
262
269
|
"title": "本地系统"
|
|
263
270
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.64",
|
|
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",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"release": "semantic-release",
|
|
76
76
|
"self-hosting:docker": "docker build -t lobehub:local .",
|
|
77
77
|
"self-hosting:docker-cn": "docker build -t lobehub-local --build-arg USE_CN_MIRROR=true .",
|
|
78
|
-
"self-hosting:docker-cn@lite": "docker build -t lobehub-lite-local -f Dockerfile.lite --build-arg USE_CN_MIRROR=true .",
|
|
79
78
|
"start": "next start -p 3210",
|
|
80
79
|
"stylelint": "stylelint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
81
80
|
"test": "npm run test-app && npm run test-server",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
|
|
2
|
+
import { ChatToolPayload } from '@lobechat/types';
|
|
3
|
+
|
|
2
4
|
import type { AgentState, ToolsCalling } from './state';
|
|
3
|
-
import { ChatToolPayload } from '@/types/message';
|
|
4
5
|
|
|
5
6
|
export interface AgentEventInit {
|
|
6
7
|
type: 'init';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { AssistantContentBlock } from '@lobechat/types';
|
|
1
2
|
import { describe, expect, it } from 'vitest';
|
|
2
3
|
|
|
3
|
-
import type { AssistantContentBlock } from '@/types/index';
|
|
4
|
-
|
|
5
4
|
import type { Message } from '../../types';
|
|
6
5
|
import { MessageTransformer } from '../MessageTransformer';
|
|
7
6
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { ClientDBLoadingProgress, DatabaseLoadingState } from '@lobechat/types';
|
|
1
2
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
3
|
|
|
3
|
-
import { ClientDBLoadingProgress, DatabaseLoadingState } from '@/types/clientDB';
|
|
4
|
-
|
|
5
4
|
import { DatabaseManager } from './db';
|
|
6
5
|
|
|
7
6
|
// Mock 所有外部依赖
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ClientDBLoadingProgress,
|
|
3
|
+
DatabaseLoadingState,
|
|
4
|
+
type MigrationSQL,
|
|
5
|
+
type MigrationTableItem,
|
|
6
|
+
} from '@lobechat/types';
|
|
1
7
|
import { sql } from 'drizzle-orm';
|
|
2
8
|
import { PgliteDatabase, drizzle } from 'drizzle-orm/pglite';
|
|
3
9
|
import { Md5 } from 'ts-md5';
|
|
4
10
|
|
|
5
|
-
import {
|
|
6
|
-
ClientDBLoadingProgress,
|
|
7
|
-
DatabaseLoadingState,
|
|
8
|
-
MigrationSQL,
|
|
9
|
-
MigrationTableItem,
|
|
10
|
-
} from '@/types/clientDB';
|
|
11
11
|
import { sleep } from '@/utils/sleep';
|
|
12
12
|
|
|
13
13
|
import migrations from '../core/migrations.json';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PGlite } from '@electric-sql/pglite';
|
|
2
2
|
import { vector } from '@electric-sql/pglite/vector';
|
|
3
|
+
import type { MigrationTableItem } from '@lobechat/types';
|
|
3
4
|
import { drizzle as pgliteDrizzle } from 'drizzle-orm/pglite';
|
|
4
5
|
import fs from 'node:fs';
|
|
5
6
|
import { Md5 } from 'ts-md5';
|
|
6
7
|
|
|
7
8
|
import { electronIpcClient } from '@/server/modules/ElectronIPCClient';
|
|
8
|
-
import { MigrationTableItem } from '@/types/clientDB';
|
|
9
9
|
|
|
10
10
|
import { DrizzleMigrationModel } from '../models/drizzleMigration';
|
|
11
11
|
import * as schema from '../schemas';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
|
+
import { AsyncTaskStatus, AsyncTaskType } from '@lobechat/types';
|
|
2
3
|
import { eq } from 'drizzle-orm';
|
|
3
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
|
|
5
|
-
import { AsyncTaskStatus, AsyncTaskType } from '@/types/asyncTask';
|
|
6
|
-
|
|
7
6
|
import { asyncTasks, users } from '../../schemas';
|
|
8
7
|
import { LobeChatDatabase } from '../../type';
|
|
9
8
|
import { ASYNC_TASK_TIMEOUT, AsyncTaskModel } from '../asyncTask';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
|
+
import { FilesTabs, SortType } from '@lobechat/types';
|
|
2
3
|
import { eq, inArray } from 'drizzle-orm';
|
|
3
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
|
|
5
|
-
import { FilesTabs, SortType } from '@/types/files';
|
|
6
|
-
|
|
7
6
|
import {
|
|
8
7
|
chunks,
|
|
9
8
|
embeddings,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
2
|
import { AsyncTaskStatus, ImageGenerationAsset } from '@lobechat/types';
|
|
3
|
+
import { FileSource } from '@lobechat/types';
|
|
3
4
|
import { eq } from 'drizzle-orm';
|
|
4
5
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
6
|
|
|
6
|
-
import { FileSource } from '@/types/files';
|
|
7
|
-
|
|
8
7
|
import {
|
|
9
8
|
NewGeneration,
|
|
10
9
|
asyncTasks,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
2
|
import { GenerationConfig } from '@lobechat/types';
|
|
3
|
+
import { AsyncTaskStatus } from '@lobechat/types';
|
|
3
4
|
import { eq } from 'drizzle-orm';
|
|
4
5
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
6
|
|
|
6
|
-
import { AsyncTaskStatus } from '@/types/asyncTask';
|
|
7
|
-
|
|
8
7
|
import {
|
|
9
8
|
NewGenerationBatch,
|
|
10
9
|
generationBatches,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isEmpty } from 'lodash-es';
|
|
3
|
-
import { ModelProvider } from 'model-bank';
|
|
4
|
-
|
|
5
|
-
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
|
6
|
-
import {
|
|
1
|
+
import type {
|
|
7
2
|
AiProviderDetailItem,
|
|
8
3
|
AiProviderListItem,
|
|
9
4
|
AiProviderRuntimeConfig,
|
|
10
5
|
CreateAiProviderParams,
|
|
11
6
|
UpdateAiProviderConfigParams,
|
|
12
|
-
} from '
|
|
7
|
+
} from '@lobechat/types';
|
|
8
|
+
import { and, asc, desc, eq } from 'drizzle-orm';
|
|
9
|
+
import { isEmpty } from 'lodash-es';
|
|
10
|
+
import { ModelProvider } from 'model-bank';
|
|
11
|
+
|
|
12
|
+
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
|
13
13
|
import { merge } from '@/utils/merge';
|
|
14
14
|
|
|
15
15
|
import { AiProviderSelectItem, aiModels, aiProviders } from '../schemas';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AiProviderDetailItem,
|
|
3
|
+
AiProviderListItem,
|
|
4
|
+
AiProviderRuntimeConfig,
|
|
5
|
+
EnabledProvider,
|
|
6
|
+
} from '@lobechat/types';
|
|
1
7
|
import { AiProviderModelListItem, EnabledAiModel } from 'model-bank';
|
|
2
8
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
9
|
|
|
4
10
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
|
5
11
|
import { clientDB, initializeDB } from '@/database/client/db';
|
|
6
|
-
import {
|
|
7
|
-
AiProviderDetailItem,
|
|
8
|
-
AiProviderListItem,
|
|
9
|
-
AiProviderRuntimeConfig,
|
|
10
|
-
EnabledProvider,
|
|
11
|
-
} from '@/types/aiProvider';
|
|
12
12
|
|
|
13
13
|
import { AiInfraRepos } from './index';
|
|
14
14
|
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AiProviderDetailItem,
|
|
3
|
+
AiProviderListItem,
|
|
4
|
+
AiProviderRuntimeState,
|
|
5
|
+
EnabledProvider,
|
|
6
|
+
ProviderConfig,
|
|
7
|
+
} from '@lobechat/types';
|
|
1
8
|
import { isEmpty } from 'lodash-es';
|
|
2
9
|
import {
|
|
3
10
|
AIChatModelCard,
|
|
@@ -8,13 +15,6 @@ import {
|
|
|
8
15
|
import pMap from 'p-map';
|
|
9
16
|
|
|
10
17
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
|
11
|
-
import {
|
|
12
|
-
AiProviderDetailItem,
|
|
13
|
-
AiProviderListItem,
|
|
14
|
-
AiProviderRuntimeState,
|
|
15
|
-
EnabledProvider,
|
|
16
|
-
} from '@/types/aiProvider';
|
|
17
|
-
import { ProviderConfig } from '@/types/user/settings';
|
|
18
18
|
import { merge, mergeArrayById } from '@/utils/merge';
|
|
19
19
|
|
|
20
20
|
import { AiModelModel } from '../../models/aiModel';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import type { ImportPgDataStructure } from '@lobechat/types';
|
|
1
2
|
import { eq, inArray } from 'drizzle-orm';
|
|
2
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
4
|
|
|
4
|
-
import { ImportPgDataStructure } from '@/types/export';
|
|
5
|
-
|
|
6
5
|
import { getTestDB } from '../../../models/__tests__/_util';
|
|
7
6
|
import * as Schema from '../../../schemas';
|
|
8
7
|
import { DataImporterRepos } from '../index';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
|
+
import type { ImporterEntryData } from '@lobechat/types';
|
|
2
3
|
import { eq, inArray } from 'drizzle-orm';
|
|
3
4
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
|
|
@@ -12,7 +13,6 @@ import {
|
|
|
12
13
|
topics,
|
|
13
14
|
users,
|
|
14
15
|
} from '@/database/schemas';
|
|
15
|
-
import { ImporterEntryData } from '@/types/importer';
|
|
16
16
|
|
|
17
17
|
import { DeprecatedDataImporterRepos as DataImporterRepos } from '../index';
|
|
18
18
|
import mockImportData from './fixtures/messages.json';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { ImportPgDataStructure, ImportResultData, ImporterEntryData } from '@lobechat/types';
|
|
1
2
|
import { and, eq, inArray } from 'drizzle-orm';
|
|
2
3
|
|
|
3
|
-
import { ImportPgDataStructure } from '@/types/export';
|
|
4
|
-
import { ImportResultData, ImporterEntryData } from '@/types/importer';
|
|
5
4
|
import { uuid } from '@/utils/uuid';
|
|
6
5
|
|
|
7
6
|
import * as EXPORT_TABLES from '../../schemas';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import pMap from 'p-map';
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
import type {
|
|
5
2
|
FilterCondition,
|
|
6
3
|
PaginationParams,
|
|
7
4
|
TableBasicInfo,
|
|
8
5
|
TableColumnInfo,
|
|
9
|
-
} from '
|
|
6
|
+
} from '@lobechat/types';
|
|
7
|
+
import { sql } from 'drizzle-orm';
|
|
8
|
+
import pMap from 'p-map';
|
|
10
9
|
|
|
11
10
|
import { LobeChatDatabase } from '../../type';
|
|
12
11
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2
|
+
import type { LobeAgentChatConfig, LobeAgentTTSConfig } from '@lobechat/types';
|
|
2
3
|
import {
|
|
3
4
|
boolean,
|
|
4
5
|
index,
|
|
@@ -11,8 +12,6 @@ import {
|
|
|
11
12
|
} from 'drizzle-orm/pg-core';
|
|
12
13
|
import { createInsertSchema } from 'drizzle-zod';
|
|
13
14
|
|
|
14
|
-
import { LobeAgentChatConfig, LobeAgentTTSConfig } from '@/types/agent';
|
|
15
|
-
|
|
16
15
|
import { idGenerator, randomSlug } from '../utils/idGenerator';
|
|
17
16
|
import { timestamps } from './_helpers';
|
|
18
17
|
import { files, knowledgeBases } from './file';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2
|
+
import type { AiProviderConfig, AiProviderSettings } from '@lobechat/types';
|
|
2
3
|
import { boolean, integer, jsonb, pgTable, primaryKey, text, varchar } from 'drizzle-orm/pg-core';
|
|
3
4
|
import { AiModelSettings } from 'model-bank';
|
|
4
5
|
|
|
5
|
-
import { AiProviderConfig, AiProviderSettings } from '@/types/aiProvider';
|
|
6
|
-
|
|
7
6
|
import { timestamps } from './_helpers';
|
|
8
7
|
import { users } from './user';
|
|
9
8
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2
|
+
import type { LobeDocumentPage } from '@lobechat/types';
|
|
2
3
|
import {
|
|
3
4
|
index,
|
|
4
5
|
integer,
|
|
@@ -12,8 +13,6 @@ import {
|
|
|
12
13
|
} from 'drizzle-orm/pg-core';
|
|
13
14
|
import { createInsertSchema } from 'drizzle-zod';
|
|
14
15
|
|
|
15
|
-
import { LobeDocumentPage } from '@/types/document';
|
|
16
|
-
|
|
17
16
|
import { idGenerator } from '../utils/idGenerator';
|
|
18
17
|
import { createdAt, timestamps } from './_helpers';
|
|
19
18
|
import { files } from './file';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2
|
+
import { FileSource } from '@lobechat/types';
|
|
2
3
|
import {
|
|
3
4
|
boolean,
|
|
4
5
|
index,
|
|
@@ -13,8 +14,6 @@ import {
|
|
|
13
14
|
} from 'drizzle-orm/pg-core';
|
|
14
15
|
import { createInsertSchema } from 'drizzle-zod';
|
|
15
16
|
|
|
16
|
-
import { FileSource } from '@/types/files';
|
|
17
|
-
|
|
18
17
|
import { idGenerator } from '../utils/idGenerator';
|
|
19
18
|
import { accessedAt, createdAt, timestamps } from './_helpers';
|
|
20
19
|
import { asyncTasks } from './asyncTask';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2
|
+
import type { ChatTopicMetadata } from '@lobechat/types';
|
|
2
3
|
import { boolean, index, jsonb, pgTable, primaryKey, text, uniqueIndex } from 'drizzle-orm/pg-core';
|
|
3
4
|
import { createInsertSchema } from 'drizzle-zod';
|
|
4
5
|
|
|
5
|
-
import { ChatTopicMetadata } from '@/types/topic';
|
|
6
|
-
|
|
7
6
|
import { idGenerator } from '../utils/idGenerator';
|
|
8
7
|
import { createdAt, timestamps, timestamptz } from './_helpers';
|
|
9
8
|
import { chatGroups } from './chatGroup';
|