@lobehub/lobehub 2.0.0-next.63 → 2.0.0-next.65
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 +5 -0
- package/locales/bg-BG/plugin.json +5 -0
- package/locales/de-DE/plugin.json +5 -0
- package/locales/es-ES/plugin.json +5 -0
- package/locales/fa-IR/plugin.json +5 -0
- package/locales/fr-FR/plugin.json +5 -0
- package/locales/it-IT/plugin.json +5 -0
- package/locales/ja-JP/plugin.json +5 -0
- package/locales/ko-KR/plugin.json +5 -0
- package/locales/nl-NL/plugin.json +5 -0
- package/locales/pl-PL/plugin.json +5 -0
- package/locales/pt-BR/plugin.json +5 -0
- package/locales/ru-RU/plugin.json +5 -0
- package/locales/tr-TR/plugin.json +5 -0
- package/locales/vi-VN/plugin.json +5 -0
- package/locales/zh-CN/plugin.json +2 -2
- package/locales/zh-TW/plugin.json +5 -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/features/DataImporter/index.tsx +2 -2
- package/Dockerfile.lite +0 -272
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.65](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.64...v2.0.0-next.65)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-11-16**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Update i18n.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Update i18n, closes [#10235](https://github.com/lobehub/lobe-chat/issues/10235) ([a52c9e5](https://github.com/lobehub/lobe-chat/commit/a52c9e5))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 2.0.0-next.64](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.63...v2.0.0-next.64)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2025-11-15**</sup>
|
|
33
|
+
|
|
34
|
+
#### ♻ Code Refactoring
|
|
35
|
+
|
|
36
|
+
- **misc**: Refactor package types.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Code refactoring
|
|
44
|
+
|
|
45
|
+
- **misc**: Refactor package types, closes [#10233](https://github.com/lobehub/lobe-chat/issues/10233) ([9872409](https://github.com/lobehub/lobe-chat/commit/9872409))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 2.0.0-next.63](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.62...v2.0.0-next.63)
|
|
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
|
+
"Update i18n."
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
"date": "2025-11-16",
|
|
9
|
+
"version": "2.0.0-next.65"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"children": {
|
|
13
|
+
"improvements": [
|
|
14
|
+
"Refactor package types."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"date": "2025-11-15",
|
|
18
|
+
"version": "2.0.0-next.64"
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"children": {
|
|
4
22
|
"features": [
|
package/locales/ar/plugin.json
CHANGED
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "تحرير الملف",
|
|
257
|
+
"getCommandOutput": "الحصول على مخرجات الأوامر",
|
|
258
|
+
"globLocalFiles": "البحث عن الملفات المطابقة",
|
|
259
|
+
"grepContent": "البحث في المحتوى",
|
|
260
|
+
"killCommand": "إيقاف تنفيذ الأمر",
|
|
256
261
|
"listLocalFiles": "عرض قائمة الملفات",
|
|
257
262
|
"moveLocalFiles": "نقل الملفات",
|
|
258
263
|
"readLocalFile": "قراءة محتوى الملف",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Редактиране на файл",
|
|
257
|
+
"getCommandOutput": "Получаване на изход от командата",
|
|
258
|
+
"globLocalFiles": "Търсене на съвпадащи файлове",
|
|
259
|
+
"grepContent": "Търсене на съдържание",
|
|
260
|
+
"killCommand": "Прекратяване на изпълнението на командата",
|
|
256
261
|
"listLocalFiles": "Преглед на списък с файлове",
|
|
257
262
|
"moveLocalFiles": "Преместване на файлове",
|
|
258
263
|
"readLocalFile": "Четене на съдържание на файл",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Datei bearbeiten",
|
|
257
|
+
"getCommandOutput": "Codeausgabe abrufen",
|
|
258
|
+
"globLocalFiles": "Dateien durchsuchen",
|
|
259
|
+
"grepContent": "Inhalt durchsuchen",
|
|
260
|
+
"killCommand": "Codeausführung beenden",
|
|
256
261
|
"listLocalFiles": "Dateiliste anzeigen",
|
|
257
262
|
"moveLocalFiles": "Dateien verschieben",
|
|
258
263
|
"readLocalFile": "Dateiinhalt lesen",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Editar archivo",
|
|
257
|
+
"getCommandOutput": "Obtener salida del código",
|
|
258
|
+
"globLocalFiles": "Buscar archivos coincidentes",
|
|
259
|
+
"grepContent": "Buscar contenido",
|
|
260
|
+
"killCommand": "Detener ejecución del código",
|
|
256
261
|
"listLocalFiles": "Ver lista de archivos",
|
|
257
262
|
"moveLocalFiles": "Mover archivos",
|
|
258
263
|
"readLocalFile": "Leer contenido del archivo",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "ویرایش فایل",
|
|
257
|
+
"getCommandOutput": "دریافت خروجی کد",
|
|
258
|
+
"globLocalFiles": "جستجوی فایلها با الگو",
|
|
259
|
+
"grepContent": "جستجوی محتوا",
|
|
260
|
+
"killCommand": "متوقف کردن اجرای کد",
|
|
256
261
|
"listLocalFiles": "مشاهده لیست فایلها",
|
|
257
262
|
"moveLocalFiles": "جابجایی فایلها",
|
|
258
263
|
"readLocalFile": "خواندن محتوای فایل",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Modifier le fichier",
|
|
257
|
+
"getCommandOutput": "Obtenir la sortie du code",
|
|
258
|
+
"globLocalFiles": "Rechercher des fichiers correspondants",
|
|
259
|
+
"grepContent": "Rechercher dans le contenu",
|
|
260
|
+
"killCommand": "Arrêter l'exécution du code",
|
|
256
261
|
"listLocalFiles": "Voir la liste des fichiers",
|
|
257
262
|
"moveLocalFiles": "Déplacer les fichiers",
|
|
258
263
|
"readLocalFile": "Lire le contenu du fichier",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Modifica file",
|
|
257
|
+
"getCommandOutput": "Ottieni output del codice",
|
|
258
|
+
"globLocalFiles": "Cerca file corrispondenti",
|
|
259
|
+
"grepContent": "Cerca contenuto",
|
|
260
|
+
"killCommand": "Termina esecuzione del codice",
|
|
256
261
|
"listLocalFiles": "Visualizza lista file",
|
|
257
262
|
"moveLocalFiles": "Sposta file",
|
|
258
263
|
"readLocalFile": "Leggi contenuto file",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "ファイルを編集",
|
|
257
|
+
"getCommandOutput": "コード出力を取得",
|
|
258
|
+
"globLocalFiles": "ファイルを検索",
|
|
259
|
+
"grepContent": "内容を検索",
|
|
260
|
+
"killCommand": "コードの実行を停止",
|
|
256
261
|
"listLocalFiles": "ファイル一覧を表示",
|
|
257
262
|
"moveLocalFiles": "ファイルを移動",
|
|
258
263
|
"readLocalFile": "ファイル内容を読み込み",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "파일 편집",
|
|
257
|
+
"getCommandOutput": "코드 출력 가져오기",
|
|
258
|
+
"globLocalFiles": "파일 검색",
|
|
259
|
+
"grepContent": "내용 검색",
|
|
260
|
+
"killCommand": "코드 실행 중지",
|
|
256
261
|
"listLocalFiles": "파일 목록 보기",
|
|
257
262
|
"moveLocalFiles": "파일 이동",
|
|
258
263
|
"readLocalFile": "파일 내용 읽기",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Bestand bewerken",
|
|
257
|
+
"getCommandOutput": "Code-uitvoer ophalen",
|
|
258
|
+
"globLocalFiles": "Bestanden zoeken",
|
|
259
|
+
"grepContent": "Inhoud doorzoeken",
|
|
260
|
+
"killCommand": "Code-uitvoering beëindigen",
|
|
256
261
|
"listLocalFiles": "Bestandslijst bekijken",
|
|
257
262
|
"moveLocalFiles": "Bestanden verplaatsen",
|
|
258
263
|
"readLocalFile": "Bestandsinhoud lezen",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Edytuj plik",
|
|
257
|
+
"getCommandOutput": "Pobierz wynik polecenia",
|
|
258
|
+
"globLocalFiles": "Wyszukaj pasujące pliki",
|
|
259
|
+
"grepContent": "Przeszukaj zawartość",
|
|
260
|
+
"killCommand": "Zatrzymaj wykonywanie polecenia",
|
|
256
261
|
"listLocalFiles": "Wyświetl listę plików",
|
|
257
262
|
"moveLocalFiles": "Przenieś pliki",
|
|
258
263
|
"readLocalFile": "Odczytaj zawartość pliku",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Editar arquivo",
|
|
257
|
+
"getCommandOutput": "Obter saída do código",
|
|
258
|
+
"globLocalFiles": "Buscar arquivos correspondentes",
|
|
259
|
+
"grepContent": "Procurar conteúdo",
|
|
260
|
+
"killCommand": "Encerrar execução do código",
|
|
256
261
|
"listLocalFiles": "Ver lista de arquivos",
|
|
257
262
|
"moveLocalFiles": "Mover arquivos",
|
|
258
263
|
"readLocalFile": "Ler conteúdo do arquivo",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Редактировать файл",
|
|
257
|
+
"getCommandOutput": "Получить вывод команды",
|
|
258
|
+
"globLocalFiles": "Поиск файлов по шаблону",
|
|
259
|
+
"grepContent": "Поиск по содержимому",
|
|
260
|
+
"killCommand": "Прервать выполнение команды",
|
|
256
261
|
"listLocalFiles": "Просмотр списка файлов",
|
|
257
262
|
"moveLocalFiles": "Перемещение файлов",
|
|
258
263
|
"readLocalFile": "Чтение содержимого файла",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Dosyayı Düzenle",
|
|
257
|
+
"getCommandOutput": "Komut Çıktısını Al",
|
|
258
|
+
"globLocalFiles": "Dosyaları Ara",
|
|
259
|
+
"grepContent": "İçeriği Ara",
|
|
260
|
+
"killCommand": "Komut Yürütmesini Durdur",
|
|
256
261
|
"listLocalFiles": "Dosya listesini görüntüle",
|
|
257
262
|
"moveLocalFiles": "Dosya taşı",
|
|
258
263
|
"readLocalFile": "Dosya içeriğini oku",
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "Chỉnh sửa tệp",
|
|
257
|
+
"getCommandOutput": "Lấy đầu ra mã lệnh",
|
|
258
|
+
"globLocalFiles": "Tìm kiếm tệp",
|
|
259
|
+
"grepContent": "Tìm kiếm nội dung",
|
|
260
|
+
"killCommand": "Dừng thực thi mã",
|
|
256
261
|
"listLocalFiles": "Xem danh sách tệp",
|
|
257
262
|
"moveLocalFiles": "Di chuyển tệp",
|
|
258
263
|
"readLocalFile": "Đọc nội dung tệp",
|
|
@@ -253,6 +253,7 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "编辑文件",
|
|
256
257
|
"getCommandOutput": "获取代码输出",
|
|
257
258
|
"globLocalFiles": "匹配搜索文件",
|
|
258
259
|
"grepContent": "搜索内容",
|
|
@@ -263,8 +264,7 @@
|
|
|
263
264
|
"renameLocalFile": "重命名",
|
|
264
265
|
"runCommand": "执行代码",
|
|
265
266
|
"searchLocalFiles": "搜索文件",
|
|
266
|
-
"writeLocalFile": "写入文件"
|
|
267
|
-
"editLocalFile": "编辑文件"
|
|
267
|
+
"writeLocalFile": "写入文件"
|
|
268
268
|
},
|
|
269
269
|
"title": "本地系统"
|
|
270
270
|
},
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
},
|
|
254
254
|
"localSystem": {
|
|
255
255
|
"apiName": {
|
|
256
|
+
"editLocalFile": "編輯檔案",
|
|
257
|
+
"getCommandOutput": "取得程式輸出",
|
|
258
|
+
"globLocalFiles": "匹配搜尋檔案",
|
|
259
|
+
"grepContent": "搜尋內容",
|
|
260
|
+
"killCommand": "終止程式執行",
|
|
256
261
|
"listLocalFiles": "查看檔案列表",
|
|
257
262
|
"moveLocalFiles": "移動檔案",
|
|
258
263
|
"readLocalFile": "讀取檔案內容",
|
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.65",
|
|
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';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2
|
+
import type { CustomPluginParams } from '@lobechat/types';
|
|
2
3
|
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
|
3
4
|
import { boolean, jsonb, pgTable, primaryKey, text } from 'drizzle-orm/pg-core';
|
|
4
5
|
|
|
5
6
|
import { DEFAULT_PREFERENCE } from '@/const/user';
|
|
6
|
-
import { CustomPluginParams } from '@/types/tool/plugin';
|
|
7
7
|
|
|
8
8
|
import { timestamps, timestamptz } from './_helpers';
|
|
9
9
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UserGuide, UserPreference } from '@lobechat/types';
|
|
1
2
|
import { TRPCError } from '@trpc/server';
|
|
2
3
|
import dayjs from 'dayjs';
|
|
3
4
|
import { count, eq } from 'drizzle-orm';
|
|
@@ -5,7 +6,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
|
5
6
|
|
|
6
7
|
import { INBOX_SESSION_ID } from '@/const/session';
|
|
7
8
|
import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';
|
|
8
|
-
import { UserGuide, UserPreference } from '@/types/user';
|
|
9
9
|
|
|
10
10
|
import { getTestDBInstance } from '../../../core/dbForTest';
|
|
11
11
|
import { SessionModel } from '../../../models/session';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenerateContentResponse } from '@google/genai';
|
|
2
|
-
|
|
3
|
-
import { GroundingSearch } from '@/types/search';
|
|
2
|
+
import { GroundingSearch } from '@lobechat/types';
|
|
4
3
|
|
|
5
4
|
import { nanoid } from '../../utils/uuid';
|
|
6
5
|
import { convertGoogleAIUsage } from '../usageConverters/google-ai';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
|
+
import type { ComfyUIKeyVault } from '@lobechat/types';
|
|
2
3
|
import { createBasicAuthCredentials } from '@lobechat/utils';
|
|
3
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
|
|
5
|
-
import type { ComfyUIKeyVault } from '@/types/index';
|
|
6
|
-
|
|
7
6
|
import type { CreateImagePayload } from '../../../types/image';
|
|
8
7
|
import { LobeComfyUI } from '../index';
|
|
9
8
|
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import type { ComfyUIKeyVault } from '@lobechat/types';
|
|
1
2
|
import { createBasicAuthCredentials } from '@lobechat/utils';
|
|
2
3
|
import debug from 'debug';
|
|
3
4
|
|
|
4
|
-
import type { ComfyUIKeyVault } from '@/types/index';
|
|
5
|
-
|
|
6
5
|
import { LobeRuntimeAI } from '../../core/BaseAI';
|
|
7
|
-
import {
|
|
8
|
-
AuthenticatedImageRuntime,
|
|
9
|
-
CreateImagePayload,
|
|
10
|
-
CreateImageResponse,
|
|
11
|
-
} from '../../types/image';
|
|
6
|
+
import { AuthenticatedImageRuntime, CreateImagePayload, CreateImageResponse } from '../../types';
|
|
12
7
|
import { parseComfyUIErrorMessage } from '../../utils/comfyuiErrorParser';
|
|
13
8
|
import { AgentRuntimeError } from '../../utils/createError';
|
|
14
9
|
|
|
@@ -116,7 +116,7 @@ export enum ImportStage {
|
|
|
116
116
|
Finished,
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
export interface
|
|
119
|
+
export interface ImportFileUploadState {
|
|
120
120
|
progress: number;
|
|
121
121
|
/**
|
|
122
122
|
* rest time in ms
|
|
@@ -137,7 +137,7 @@ export interface ErrorShape {
|
|
|
137
137
|
|
|
138
138
|
export interface OnImportCallbacks {
|
|
139
139
|
onError?: (error: ErrorShape) => void;
|
|
140
|
-
onFileUploading?: (state:
|
|
140
|
+
onFileUploading?: (state: ImportFileUploadState) => void;
|
|
141
141
|
onStageChange?: (stage: ImportStage) => void;
|
|
142
142
|
/**
|
|
143
143
|
*
|
|
@@ -8,11 +8,14 @@ export * from './chatGroup';
|
|
|
8
8
|
export * from './chunk';
|
|
9
9
|
export * from './clientDB';
|
|
10
10
|
export * from './discover';
|
|
11
|
+
export * from './document';
|
|
11
12
|
export * from './eval';
|
|
13
|
+
export * from './export';
|
|
12
14
|
export * from './fetch';
|
|
13
15
|
export * from './files';
|
|
14
16
|
export * from './generation';
|
|
15
17
|
export * from './hotkey';
|
|
18
|
+
export * from './importer';
|
|
16
19
|
export * from './knowledgeBase';
|
|
17
20
|
export * from './llm';
|
|
18
21
|
export * from './message';
|
|
@@ -23,6 +26,7 @@ export * from './search';
|
|
|
23
26
|
export * from './serverConfig';
|
|
24
27
|
export * from './service';
|
|
25
28
|
export * from './session';
|
|
29
|
+
export * from './tableViewer';
|
|
26
30
|
export * from './tool';
|
|
27
31
|
export * from './topic';
|
|
28
32
|
export * from './user';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { ErrorShape, ImportFileUploadState, ImportStage } from '@lobechat/types';
|
|
3
4
|
import { Upload } from 'antd';
|
|
4
5
|
import { createStyles } from 'antd-style';
|
|
5
6
|
import { ImportIcon } from 'lucide-react';
|
|
@@ -12,7 +13,6 @@ import { importService } from '@/services/import';
|
|
|
12
13
|
import { useChatStore } from '@/store/chat';
|
|
13
14
|
import { useSessionStore } from '@/store/session';
|
|
14
15
|
import { ImportPgDataStructure } from '@/types/export';
|
|
15
|
-
import { ErrorShape, FileUploadState, ImportStage } from '@/types/importer';
|
|
16
16
|
|
|
17
17
|
import ImportError from './Error';
|
|
18
18
|
import { FileUploading } from './FileUploading';
|
|
@@ -64,7 +64,7 @@ const DataImporter = memo<DataImporterProps>(({ children, onFinishImport }) => {
|
|
|
64
64
|
const [duration, setDuration] = useState(0);
|
|
65
65
|
const [importState, setImportState] = useState(ImportStage.Start);
|
|
66
66
|
|
|
67
|
-
const [fileUploadingState, setUploadingState] = useState<
|
|
67
|
+
const [fileUploadingState, setUploadingState] = useState<ImportFileUploadState | undefined>();
|
|
68
68
|
const [importError, setImportError] = useState<ErrorShape | undefined>();
|
|
69
69
|
const [importResults, setImportResults] = useState<ImportResults | undefined>();
|
|
70
70
|
const [showImportModal, setShowImportModal] = useState(false);
|
package/Dockerfile.lite
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
## Set global build ENV
|
|
2
|
-
ARG NODEJS_VERSION="24"
|
|
3
|
-
|
|
4
|
-
## Base image for all building stages
|
|
5
|
-
FROM node:${NODEJS_VERSION}-slim AS base
|
|
6
|
-
|
|
7
|
-
ARG USE_CN_MIRROR
|
|
8
|
-
|
|
9
|
-
ENV DEBIAN_FRONTEND="noninteractive"
|
|
10
|
-
|
|
11
|
-
RUN \
|
|
12
|
-
# If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true
|
|
13
|
-
if [ "${USE_CN_MIRROR:-false}" = "true" ]; then \
|
|
14
|
-
sed -i "s/deb.debian.org/mirrors.ustc.edu.cn/g" "/etc/apt/sources.list.d/debian.sources"; \
|
|
15
|
-
fi \
|
|
16
|
-
# Add required package
|
|
17
|
-
&& apt update \
|
|
18
|
-
&& apt install ca-certificates proxychains-ng -qy \
|
|
19
|
-
# Prepare required package to distroless
|
|
20
|
-
&& mkdir -p /distroless/bin /distroless/etc /distroless/etc/ssl/certs /distroless/lib \
|
|
21
|
-
# Copy proxychains to distroless
|
|
22
|
-
&& cp /usr/lib/$(arch)-linux-gnu/libproxychains.so.4 /distroless/lib/libproxychains.so.4 \
|
|
23
|
-
&& cp /usr/lib/$(arch)-linux-gnu/libdl.so.2 /distroless/lib/libdl.so.2 \
|
|
24
|
-
&& cp /usr/bin/proxychains4 /distroless/bin/proxychains \
|
|
25
|
-
&& cp /etc/proxychains4.conf /distroless/etc/proxychains4.conf \
|
|
26
|
-
# Copy node to distroless
|
|
27
|
-
&& cp /usr/lib/$(arch)-linux-gnu/libstdc++.so.6 /distroless/lib/libstdc++.so.6 \
|
|
28
|
-
&& cp /usr/lib/$(arch)-linux-gnu/libgcc_s.so.1 /distroless/lib/libgcc_s.so.1 \
|
|
29
|
-
&& cp /usr/local/bin/node /distroless/bin/node \
|
|
30
|
-
# Copy CA certificates to distroless
|
|
31
|
-
&& cp /etc/ssl/certs/ca-certificates.crt /distroless/etc/ssl/certs/ca-certificates.crt \
|
|
32
|
-
# Cleanup temp files
|
|
33
|
-
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
|
|
34
|
-
|
|
35
|
-
## Builder image, install all the dependencies and build the app
|
|
36
|
-
FROM base AS builder
|
|
37
|
-
|
|
38
|
-
ARG USE_CN_MIRROR
|
|
39
|
-
ARG NEXT_PUBLIC_BASE_PATH
|
|
40
|
-
ARG NEXT_PUBLIC_SENTRY_DSN
|
|
41
|
-
ARG NEXT_PUBLIC_ANALYTICS_POSTHOG
|
|
42
|
-
ARG NEXT_PUBLIC_POSTHOG_HOST
|
|
43
|
-
ARG NEXT_PUBLIC_POSTHOG_KEY
|
|
44
|
-
ARG NEXT_PUBLIC_ANALYTICS_UMAMI
|
|
45
|
-
ARG NEXT_PUBLIC_UMAMI_SCRIPT_URL
|
|
46
|
-
ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID
|
|
47
|
-
ARG FEATURE_FLAGS
|
|
48
|
-
|
|
49
|
-
ENV NEXT_PUBLIC_CLIENT_DB="pglite"
|
|
50
|
-
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}" \
|
|
51
|
-
FEATURE_FLAGS="${FEATURE_FLAGS}"
|
|
52
|
-
|
|
53
|
-
# Sentry
|
|
54
|
-
ENV NEXT_PUBLIC_SENTRY_DSN="${NEXT_PUBLIC_SENTRY_DSN}" \
|
|
55
|
-
SENTRY_ORG="" \
|
|
56
|
-
SENTRY_PROJECT=""
|
|
57
|
-
|
|
58
|
-
ENV APP_URL="http://app.com"
|
|
59
|
-
|
|
60
|
-
# Posthog
|
|
61
|
-
ENV NEXT_PUBLIC_ANALYTICS_POSTHOG="${NEXT_PUBLIC_ANALYTICS_POSTHOG}" \
|
|
62
|
-
NEXT_PUBLIC_POSTHOG_HOST="${NEXT_PUBLIC_POSTHOG_HOST}" \
|
|
63
|
-
NEXT_PUBLIC_POSTHOG_KEY="${NEXT_PUBLIC_POSTHOG_KEY}"
|
|
64
|
-
|
|
65
|
-
# Umami
|
|
66
|
-
ENV NEXT_PUBLIC_ANALYTICS_UMAMI="${NEXT_PUBLIC_ANALYTICS_UMAMI}" \
|
|
67
|
-
NEXT_PUBLIC_UMAMI_SCRIPT_URL="${NEXT_PUBLIC_UMAMI_SCRIPT_URL}" \
|
|
68
|
-
NEXT_PUBLIC_UMAMI_WEBSITE_ID="${NEXT_PUBLIC_UMAMI_WEBSITE_ID}"
|
|
69
|
-
|
|
70
|
-
# Node
|
|
71
|
-
ENV NODE_OPTIONS="--max-old-space-size=6144"
|
|
72
|
-
|
|
73
|
-
WORKDIR /app
|
|
74
|
-
|
|
75
|
-
COPY package.json pnpm-workspace.yaml ./
|
|
76
|
-
COPY .npmrc ./
|
|
77
|
-
COPY packages ./packages
|
|
78
|
-
|
|
79
|
-
RUN \
|
|
80
|
-
# If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true
|
|
81
|
-
if [ "${USE_CN_MIRROR:-false}" = "true" ]; then \
|
|
82
|
-
export SENTRYCLI_CDNURL="https://npmmirror.com/mirrors/sentry-cli"; \
|
|
83
|
-
npm config set registry "https://registry.npmmirror.com/"; \
|
|
84
|
-
echo 'canvas_binary_host_mirror=https://npmmirror.com/mirrors/canvas' >> .npmrc; \
|
|
85
|
-
fi \
|
|
86
|
-
# Set the registry for corepack
|
|
87
|
-
&& export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\/$//') \
|
|
88
|
-
# Update corepack to latest (nodejs/corepack#612)
|
|
89
|
-
&& npm i -g corepack@latest \
|
|
90
|
-
# Enable corepack
|
|
91
|
-
&& corepack enable \
|
|
92
|
-
# Use pnpm for corepack
|
|
93
|
-
&& corepack use $(sed -n 's/.*"packageManager": "\(.*\)".*/\1/p' package.json) \
|
|
94
|
-
# Install the dependencies
|
|
95
|
-
&& pnpm i
|
|
96
|
-
|
|
97
|
-
COPY . .
|
|
98
|
-
|
|
99
|
-
# run build standalone for docker version
|
|
100
|
-
RUN npm run build:docker
|
|
101
|
-
|
|
102
|
-
## Application image, copy all the files for production
|
|
103
|
-
FROM busybox:latest AS app
|
|
104
|
-
|
|
105
|
-
COPY --from=base /distroless/ /
|
|
106
|
-
|
|
107
|
-
# Automatically leverage output traces to reduce image size
|
|
108
|
-
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
109
|
-
COPY --from=builder /app/.next/standalone /app/
|
|
110
|
-
|
|
111
|
-
# Copy server launcher
|
|
112
|
-
COPY --from=builder /app/scripts/serverLauncher/startServer.js /app/startServer.js
|
|
113
|
-
|
|
114
|
-
RUN \
|
|
115
|
-
# Add nextjs:nodejs to run the app
|
|
116
|
-
addgroup -S -g 1001 nodejs \
|
|
117
|
-
&& adduser -D -G nodejs -H -S -h /app -u 1001 nextjs \
|
|
118
|
-
# Set permission for nextjs:nodejs
|
|
119
|
-
&& chown -R nextjs:nodejs /app /etc/proxychains4.conf
|
|
120
|
-
|
|
121
|
-
## Production image, copy all the files and run next
|
|
122
|
-
FROM scratch
|
|
123
|
-
|
|
124
|
-
# Copy all the files from app, set the correct permission for prerender cache
|
|
125
|
-
COPY --from=app / /
|
|
126
|
-
|
|
127
|
-
ENV NODE_ENV="production" \
|
|
128
|
-
NODE_OPTIONS="--dns-result-order=ipv4first --use-openssl-ca" \
|
|
129
|
-
NODE_EXTRA_CA_CERTS="" \
|
|
130
|
-
NODE_TLS_REJECT_UNAUTHORIZED="" \
|
|
131
|
-
SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
|
|
132
|
-
|
|
133
|
-
# Make the middleware rewrite through local as default
|
|
134
|
-
# refs: https://github.com/lobehub/lobe-chat/issues/5876
|
|
135
|
-
ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1"
|
|
136
|
-
|
|
137
|
-
# set hostname to localhost
|
|
138
|
-
ENV HOSTNAME="0.0.0.0" \
|
|
139
|
-
PORT="3210"
|
|
140
|
-
|
|
141
|
-
# General Variables
|
|
142
|
-
ENV ACCESS_CODE="" \
|
|
143
|
-
API_KEY_SELECT_MODE="" \
|
|
144
|
-
DEFAULT_AGENT_CONFIG="" \
|
|
145
|
-
SYSTEM_AGENT="" \
|
|
146
|
-
FEATURE_FLAGS="" \
|
|
147
|
-
PROXY_URL="" \
|
|
148
|
-
ENABLE_AUTH_PROTECTION=""
|
|
149
|
-
|
|
150
|
-
# Model Variables
|
|
151
|
-
ENV \
|
|
152
|
-
# AI21
|
|
153
|
-
AI21_API_KEY="" AI21_MODEL_LIST="" \
|
|
154
|
-
# Ai360
|
|
155
|
-
AI360_API_KEY="" AI360_MODEL_LIST="" \
|
|
156
|
-
# AiHubMix
|
|
157
|
-
AIHUBMIX_API_KEY="" AIHUBMIX_MODEL_LIST="" \
|
|
158
|
-
# Anthropic
|
|
159
|
-
ANTHROPIC_API_KEY="" ANTHROPIC_MODEL_LIST="" ANTHROPIC_PROXY_URL="" \
|
|
160
|
-
# Amazon Bedrock
|
|
161
|
-
ENABLED_AWS_BEDROCK="" AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
|
|
162
|
-
# Azure OpenAI
|
|
163
|
-
AZURE_API_KEY="" AZURE_API_VERSION="" AZURE_ENDPOINT="" AZURE_MODEL_LIST="" \
|
|
164
|
-
# Baichuan
|
|
165
|
-
BAICHUAN_API_KEY="" BAICHUAN_MODEL_LIST="" \
|
|
166
|
-
# Cloudflare
|
|
167
|
-
CLOUDFLARE_API_KEY="" CLOUDFLARE_BASE_URL_OR_ACCOUNT_ID="" CLOUDFLARE_MODEL_LIST="" \
|
|
168
|
-
# Cohere
|
|
169
|
-
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
|
|
170
|
-
# ComfyUI
|
|
171
|
-
ENABLED_COMFYUI="" COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
|
|
172
|
-
COMFYUI_API_KEY="" COMFYUI_USERNAME="" COMFYUI_PASSWORD="" COMFYUI_CUSTOM_HEADERS="" \
|
|
173
|
-
# DeepSeek
|
|
174
|
-
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
|
|
175
|
-
# Fireworks AI
|
|
176
|
-
FIREWORKSAI_API_KEY="" FIREWORKSAI_MODEL_LIST="" \
|
|
177
|
-
# Gitee AI
|
|
178
|
-
GITEE_AI_API_KEY="" GITEE_AI_MODEL_LIST="" \
|
|
179
|
-
# GitHub
|
|
180
|
-
GITHUB_TOKEN="" GITHUB_MODEL_LIST="" \
|
|
181
|
-
# Google
|
|
182
|
-
GOOGLE_API_KEY="" GOOGLE_MODEL_LIST="" GOOGLE_PROXY_URL="" \
|
|
183
|
-
# Groq
|
|
184
|
-
GROQ_API_KEY="" GROQ_MODEL_LIST="" GROQ_PROXY_URL="" \
|
|
185
|
-
# Higress
|
|
186
|
-
HIGRESS_API_KEY="" HIGRESS_MODEL_LIST="" HIGRESS_PROXY_URL="" \
|
|
187
|
-
# HuggingFace
|
|
188
|
-
HUGGINGFACE_API_KEY="" HUGGINGFACE_MODEL_LIST="" HUGGINGFACE_PROXY_URL="" \
|
|
189
|
-
# Hunyuan
|
|
190
|
-
HUNYUAN_API_KEY="" HUNYUAN_MODEL_LIST="" \
|
|
191
|
-
# InternLM
|
|
192
|
-
INTERNLM_API_KEY="" INTERNLM_MODEL_LIST="" \
|
|
193
|
-
# Jina
|
|
194
|
-
JINA_API_KEY="" JINA_MODEL_LIST="" JINA_PROXY_URL="" \
|
|
195
|
-
# Minimax
|
|
196
|
-
MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \
|
|
197
|
-
# Mistral
|
|
198
|
-
MISTRAL_API_KEY="" MISTRAL_MODEL_LIST="" \
|
|
199
|
-
# ModelScope
|
|
200
|
-
MODELSCOPE_API_KEY="" MODELSCOPE_MODEL_LIST="" MODELSCOPE_PROXY_URL="" \
|
|
201
|
-
# Moonshot
|
|
202
|
-
MOONSHOT_API_KEY="" MOONSHOT_MODEL_LIST="" MOONSHOT_PROXY_URL="" \
|
|
203
|
-
# Nebius
|
|
204
|
-
NEBIUS_API_KEY="" NEBIUS_MODEL_LIST="" NEBIUS_PROXY_URL="" \
|
|
205
|
-
# NewAPI
|
|
206
|
-
NEWAPI_API_KEY="" NEWAPI_PROXY_URL="" \
|
|
207
|
-
# Novita
|
|
208
|
-
NOVITA_API_KEY="" NOVITA_MODEL_LIST="" \
|
|
209
|
-
# Nvidia NIM
|
|
210
|
-
NVIDIA_API_KEY="" NVIDIA_MODEL_LIST="" NVIDIA_PROXY_URL="" \
|
|
211
|
-
# Ollama
|
|
212
|
-
ENABLED_OLLAMA="" OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
|
|
213
|
-
# OpenAI
|
|
214
|
-
ENABLED_OPENAI="" OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
|
|
215
|
-
# OpenRouter
|
|
216
|
-
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
|
|
217
|
-
# Perplexity
|
|
218
|
-
PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
|
|
219
|
-
# Qiniu
|
|
220
|
-
QINIU_API_KEY="" QINIU_MODEL_LIST="" QINIU_PROXY_URL="" \
|
|
221
|
-
# Qwen
|
|
222
|
-
QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
|
|
223
|
-
# SambaNova
|
|
224
|
-
SAMBANOVA_API_KEY="" SAMBANOVA_MODEL_LIST="" \
|
|
225
|
-
# SenseNova
|
|
226
|
-
SENSENOVA_API_KEY="" SENSENOVA_MODEL_LIST="" \
|
|
227
|
-
# SiliconCloud
|
|
228
|
-
SILICONCLOUD_API_KEY="" SILICONCLOUD_MODEL_LIST="" SILICONCLOUD_PROXY_URL="" \
|
|
229
|
-
# Spark
|
|
230
|
-
SPARK_API_KEY="" SPARK_MODEL_LIST="" SPARK_PROXY_URL="" SPARK_SEARCH_MODE="" \
|
|
231
|
-
# Stepfun
|
|
232
|
-
STEPFUN_API_KEY="" STEPFUN_MODEL_LIST="" \
|
|
233
|
-
# Taichu
|
|
234
|
-
TAICHU_API_KEY="" TAICHU_MODEL_LIST="" \
|
|
235
|
-
# TogetherAI
|
|
236
|
-
TOGETHERAI_API_KEY="" TOGETHERAI_MODEL_LIST="" \
|
|
237
|
-
# Upstage
|
|
238
|
-
UPSTAGE_API_KEY="" UPSTAGE_MODEL_LIST="" \
|
|
239
|
-
# v0 (Vercel)
|
|
240
|
-
V0_API_KEY="" V0_MODEL_LIST="" \
|
|
241
|
-
# vLLM
|
|
242
|
-
VLLM_API_KEY="" VLLM_MODEL_LIST="" VLLM_PROXY_URL="" \
|
|
243
|
-
# Wenxin
|
|
244
|
-
WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \
|
|
245
|
-
# xAI
|
|
246
|
-
XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \
|
|
247
|
-
# Xinference
|
|
248
|
-
XINFERENCE_API_KEY="" XINFERENCE_MODEL_LIST="" XINFERENCE_PROXY_URL="" \
|
|
249
|
-
# 01.AI
|
|
250
|
-
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
|
|
251
|
-
# Zhipu
|
|
252
|
-
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \
|
|
253
|
-
# Tencent Cloud
|
|
254
|
-
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST="" \
|
|
255
|
-
# Infini-AI
|
|
256
|
-
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
257
|
-
# 302.AI
|
|
258
|
-
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
259
|
-
# FAL
|
|
260
|
-
ENABLED_FAL="" FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
261
|
-
# BFL
|
|
262
|
-
BFL_API_KEY="" BFL_MODEL_LIST="" \
|
|
263
|
-
# Vercel AI Gateway
|
|
264
|
-
VERCELAIGATEWAY_API_KEY="" VERCELAIGATEWAY_MODEL_LIST=""
|
|
265
|
-
|
|
266
|
-
USER nextjs
|
|
267
|
-
|
|
268
|
-
EXPOSE 3210/tcp
|
|
269
|
-
|
|
270
|
-
ENTRYPOINT ["/bin/node"]
|
|
271
|
-
|
|
272
|
-
CMD ["/app/startServer.js"]
|