@lobehub/chat 1.76.1 → 1.77.0

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 (129) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/changelog/v1.json +9 -0
  3. package/locales/ar/common.json +12 -1
  4. package/locales/ar/error.json +10 -0
  5. package/locales/ar/models.json +9 -6
  6. package/locales/ar/setting.json +28 -0
  7. package/locales/bg-BG/common.json +12 -1
  8. package/locales/bg-BG/error.json +10 -0
  9. package/locales/bg-BG/models.json +9 -6
  10. package/locales/bg-BG/setting.json +28 -0
  11. package/locales/de-DE/common.json +12 -1
  12. package/locales/de-DE/error.json +10 -0
  13. package/locales/de-DE/models.json +9 -6
  14. package/locales/de-DE/setting.json +28 -0
  15. package/locales/en-US/common.json +12 -1
  16. package/locales/en-US/error.json +10 -0
  17. package/locales/en-US/models.json +9 -6
  18. package/locales/en-US/setting.json +28 -0
  19. package/locales/es-ES/common.json +12 -1
  20. package/locales/es-ES/error.json +10 -0
  21. package/locales/es-ES/models.json +9 -6
  22. package/locales/es-ES/setting.json +28 -0
  23. package/locales/fa-IR/common.json +12 -1
  24. package/locales/fa-IR/error.json +10 -0
  25. package/locales/fa-IR/models.json +9 -6
  26. package/locales/fa-IR/setting.json +28 -0
  27. package/locales/fr-FR/common.json +12 -1
  28. package/locales/fr-FR/error.json +10 -0
  29. package/locales/fr-FR/models.json +9 -6
  30. package/locales/fr-FR/setting.json +28 -0
  31. package/locales/it-IT/common.json +12 -1
  32. package/locales/it-IT/error.json +10 -0
  33. package/locales/it-IT/models.json +9 -6
  34. package/locales/it-IT/setting.json +28 -0
  35. package/locales/ja-JP/common.json +12 -1
  36. package/locales/ja-JP/error.json +10 -0
  37. package/locales/ja-JP/models.json +9 -6
  38. package/locales/ja-JP/setting.json +28 -0
  39. package/locales/ko-KR/common.json +12 -1
  40. package/locales/ko-KR/error.json +10 -0
  41. package/locales/ko-KR/models.json +9 -6
  42. package/locales/ko-KR/setting.json +28 -0
  43. package/locales/nl-NL/common.json +12 -1
  44. package/locales/nl-NL/error.json +10 -0
  45. package/locales/nl-NL/models.json +9 -6
  46. package/locales/nl-NL/setting.json +28 -0
  47. package/locales/pl-PL/common.json +12 -1
  48. package/locales/pl-PL/error.json +10 -0
  49. package/locales/pl-PL/models.json +9 -6
  50. package/locales/pl-PL/setting.json +28 -0
  51. package/locales/pt-BR/common.json +12 -1
  52. package/locales/pt-BR/error.json +10 -0
  53. package/locales/pt-BR/models.json +9 -6
  54. package/locales/pt-BR/setting.json +28 -0
  55. package/locales/ru-RU/common.json +12 -1
  56. package/locales/ru-RU/error.json +10 -0
  57. package/locales/ru-RU/models.json +9 -6
  58. package/locales/ru-RU/setting.json +28 -0
  59. package/locales/tr-TR/common.json +12 -1
  60. package/locales/tr-TR/error.json +10 -0
  61. package/locales/tr-TR/models.json +9 -6
  62. package/locales/tr-TR/setting.json +28 -0
  63. package/locales/vi-VN/common.json +12 -1
  64. package/locales/vi-VN/error.json +10 -0
  65. package/locales/vi-VN/models.json +9 -6
  66. package/locales/vi-VN/setting.json +28 -0
  67. package/locales/zh-CN/common.json +12 -1
  68. package/locales/zh-CN/error.json +10 -0
  69. package/locales/zh-CN/models.json +9 -6
  70. package/locales/zh-CN/setting.json +28 -0
  71. package/locales/zh-TW/common.json +12 -1
  72. package/locales/zh-TW/error.json +10 -0
  73. package/locales/zh-TW/models.json +9 -6
  74. package/locales/zh-TW/setting.json +28 -0
  75. package/package.json +1 -1
  76. package/src/app/[variants]/(main)/(mobile)/me/data/features/Category.tsx +1 -1
  77. package/src/app/[variants]/(main)/chat/features/Migration/UpgradeButton.tsx +2 -1
  78. package/src/app/[variants]/(main)/settings/common/features/Common.tsx +0 -44
  79. package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +40 -14
  80. package/src/app/[variants]/(main)/settings/storage/Advanced.tsx +133 -0
  81. package/src/app/[variants]/(main)/settings/storage/IndexedDBStorage.tsx +55 -0
  82. package/src/app/[variants]/(main)/settings/storage/page.tsx +17 -0
  83. package/src/components/GroupIcon/index.tsx +25 -0
  84. package/src/components/IndexCard/index.tsx +143 -0
  85. package/src/components/ProgressItem/index.tsx +75 -0
  86. package/src/database/repositories/dataExporter/index.test.ts +330 -0
  87. package/src/database/repositories/dataExporter/index.ts +216 -0
  88. package/src/database/repositories/dataImporter/__tests__/fixtures/agents.json +65 -0
  89. package/src/database/repositories/dataImporter/__tests__/fixtures/agentsToSessions.json +541 -0
  90. package/src/database/repositories/dataImporter/__tests__/fixtures/topic.json +269 -0
  91. package/src/database/repositories/dataImporter/__tests__/fixtures/userSettings.json +18 -0
  92. package/src/database/repositories/dataImporter/__tests__/fixtures/with-client-id.json +778 -0
  93. package/src/database/repositories/dataImporter/__tests__/index.test.ts +120 -880
  94. package/src/database/repositories/dataImporter/deprecated/__tests__/index.test.ts +940 -0
  95. package/src/database/repositories/dataImporter/deprecated/index.ts +326 -0
  96. package/src/database/repositories/dataImporter/index.ts +684 -289
  97. package/src/features/DataImporter/ImportDetail.tsx +203 -0
  98. package/src/features/DataImporter/SuccessResult.tsx +22 -6
  99. package/src/features/DataImporter/_deprecated.ts +43 -0
  100. package/src/features/DataImporter/config.ts +21 -0
  101. package/src/features/DataImporter/index.tsx +112 -31
  102. package/src/features/DevPanel/PostgresViewer/DataTable/index.tsx +6 -0
  103. package/src/features/User/UserPanel/useMenu.tsx +0 -35
  104. package/src/features/User/__tests__/useMenu.test.tsx +0 -2
  105. package/src/locales/default/common.ts +11 -0
  106. package/src/locales/default/error.ts +10 -0
  107. package/src/locales/default/setting.ts +28 -0
  108. package/src/server/routers/lambda/exporter.ts +25 -0
  109. package/src/server/routers/lambda/importer.ts +19 -3
  110. package/src/server/routers/lambda/index.ts +2 -0
  111. package/src/services/config.ts +80 -135
  112. package/src/services/export/_deprecated.ts +155 -0
  113. package/src/services/export/client.ts +15 -0
  114. package/src/services/export/index.ts +6 -0
  115. package/src/services/export/server.ts +9 -0
  116. package/src/services/export/type.ts +5 -0
  117. package/src/services/import/_deprecated.ts +42 -1
  118. package/src/services/import/client.test.ts +1 -1
  119. package/src/services/import/client.ts +30 -1
  120. package/src/services/import/server.ts +70 -2
  121. package/src/services/import/type.ts +10 -0
  122. package/src/store/global/initialState.ts +1 -0
  123. package/src/types/export.ts +11 -0
  124. package/src/types/exportConfig.ts +2 -0
  125. package/src/types/importer.ts +15 -0
  126. package/src/utils/client/exportFile.ts +21 -0
  127. package/vitest.config.ts +1 -1
  128. package/src/utils/config.ts +0 -109
  129. /package/src/database/repositories/dataImporter/{__tests__ → deprecated/__tests__}/fixtures/messages.json +0 -0
@@ -0,0 +1,269 @@
1
+ {
2
+ "data": {
3
+ "agents": [
4
+ {
5
+ "id": "agt_CSLkGPIXIQms",
6
+ "slug": "room-possible-somewhere-numeral",
7
+ "title": null,
8
+ "description": null,
9
+ "tags": [],
10
+ "avatar": null,
11
+ "backgroundColor": null,
12
+ "plugins": [],
13
+ "chatConfig": {
14
+ "searchMode": "off"
15
+ },
16
+ "fewShots": null,
17
+ "model": "gemini-2.0-flash-exp",
18
+ "params": {
19
+ "top_p": 1,
20
+ "temperature": 1,
21
+ "presence_penalty": 0,
22
+ "frequency_penalty": 0
23
+ },
24
+ "provider": "google",
25
+ "systemRole": "",
26
+ "tts": {
27
+ "voice": {
28
+ "openai": "alloy"
29
+ },
30
+ "sttLocale": "auto",
31
+ "ttsService": "openai",
32
+ "showAllLocaleVoice": false
33
+ },
34
+ "accessedAt": "2025-03-05T05:25:44.521Z",
35
+ "createdAt": "2025-03-05T05:25:44.522Z",
36
+ "updatedAt": "2025-03-05T05:25:44.522Z"
37
+ }
38
+ ],
39
+ "agentsToSessions": [
40
+ {
41
+ "agentId": "agt_CSLkGPIXIQms",
42
+ "sessionId": "ssn_WdL6m1mReqyb"
43
+ }
44
+ ],
45
+ "messagePlugins": [
46
+ {
47
+ "id": "msg_xQNFoIFhaPkzK4",
48
+ "toolCallId": "toolu_01396zo96GpdEkRCvDhtfgYk",
49
+ "type": "builtin",
50
+ "apiName": "searchWithSearXNG",
51
+ "arguments": "{\"query\": \"ABC\"}",
52
+ "identifier": "lobe-web-browsing",
53
+ "state": {
54
+ "query": "ABC"
55
+ },
56
+ "error": null
57
+ }
58
+ ],
59
+ "messages": [
60
+ {
61
+ "id": "msg_NO2nnNsum6IPRk",
62
+ "role": "user",
63
+ "content": "搜下ABC的公司规模",
64
+ "reasoning": null,
65
+ "search": null,
66
+ "metadata": null,
67
+ "model": null,
68
+ "provider": null,
69
+ "favorite": false,
70
+ "error": null,
71
+ "tools": null,
72
+ "traceId": null,
73
+ "observationId": null,
74
+ "clientId": null,
75
+ "sessionId": null,
76
+ "topicId": "tpc_PJGbygbVl43e",
77
+ "threadId": null,
78
+ "parentId": null,
79
+ "quotaId": null,
80
+ "agentId": null,
81
+ "accessedAt": "2025-03-05T06:55:46.892Z",
82
+ "createdAt": "2025-03-05T06:55:46.892Z",
83
+ "updatedAt": "2025-03-05T06:55:46.892Z"
84
+ },
85
+ {
86
+ "id": "msg_HiDmdz7AgA2RYz",
87
+ "role": "tool",
88
+ "content": "[{\"content\":\"\"}]",
89
+ "reasoning": null,
90
+ "search": null,
91
+ "metadata": null,
92
+ "model": null,
93
+ "provider": null,
94
+ "favorite": false,
95
+ "error": null,
96
+ "tools": null,
97
+ "traceId": null,
98
+ "observationId": null,
99
+ "clientId": null,
100
+ "sessionId": null,
101
+ "topicId": "tpc_PJGbygbVl43e",
102
+ "threadId": null,
103
+ "parentId": "msg_8BTRw6xvNXnJep",
104
+ "quotaId": null,
105
+ "agentId": null,
106
+ "accessedAt": "2025-03-05T09:28:23.015Z",
107
+ "createdAt": "2025-03-05T09:28:23.015Z",
108
+ "updatedAt": "2025-03-05T09:28:23.015Z"
109
+ },
110
+ {
111
+ "id": "msg_9GzmTaUBTUJyDG",
112
+ "role": "assistant",
113
+ "content": "\n\n根据我收集到的最新信息,以下是关于ABC公司规模的详细情况",
114
+ "reasoning": null,
115
+ "search": null,
116
+ "metadata": {
117
+ "inputTokens": 13161,
118
+ "totalTokens": 14229,
119
+ "cachedTokens": 2076,
120
+ "outputTokens": 1068,
121
+ "inputCacheMissTokens": 6,
122
+ "inputWriteCacheTokens": 11079
123
+ },
124
+ "model": "claude-3-7-sonnet-20250219",
125
+ "provider": "anthropic",
126
+ "favorite": false,
127
+ "error": null,
128
+ "tools": null,
129
+ "traceId": null,
130
+ "observationId": null,
131
+ "clientId": null,
132
+ "sessionId": null,
133
+ "topicId": "tpc_PJGbygbVl43e",
134
+ "threadId": null,
135
+ "parentId": "msg_HiDmdz7AgA2RYz",
136
+ "quotaId": null,
137
+ "agentId": null,
138
+ "accessedAt": "2025-03-05T09:28:31.861Z",
139
+ "createdAt": "2025-03-05T09:28:31.861Z",
140
+ "updatedAt": "2025-03-05T09:28:31.861Z"
141
+ },
142
+ {
143
+ "id": "msg_VIS6XFukgdjLdL",
144
+ "role": "assistant",
145
+ "content": "我将为您搜索ABC的公司规模相关信息。",
146
+ "reasoning": null,
147
+ "search": null,
148
+ "metadata": {
149
+ "inputTokens": 2230,
150
+ "totalTokens": 2334,
151
+ "cachedTokens": 2226,
152
+ "outputTokens": 104,
153
+ "inputCacheMissTokens": 4
154
+ },
155
+ "model": "claude-3-7-sonnet-20250219",
156
+ "provider": "anthropic",
157
+ "favorite": false,
158
+ "error": null,
159
+ "tools": [
160
+ {
161
+ "id": "toolu_01396zo96GpdEkRCvDhtfgYk",
162
+ "type": "builtin",
163
+ "apiName": "searchWithSearXNG",
164
+ "arguments": "{\"query\": \"ABC 公司规模 管理规模\"}",
165
+ "identifier": "lobe-web-browsing"
166
+ }
167
+ ],
168
+ "traceId": null,
169
+ "observationId": null,
170
+ "clientId": null,
171
+ "sessionId": null,
172
+ "topicId": "tpc_PJGbygbVl43e",
173
+ "threadId": null,
174
+ "parentId": "msg_NO2nnNsum6IPRk",
175
+ "quotaId": null,
176
+ "agentId": null,
177
+ "accessedAt": "2025-03-05T09:27:43.071Z",
178
+ "createdAt": "2025-03-05T09:27:43.071Z",
179
+ "updatedAt": "2025-03-05T09:27:43.071Z"
180
+ },
181
+ {
182
+ "id": "msg_xQNFoIFhaPkzK4",
183
+ "role": "tool",
184
+ "content": "[{\"content\":\"\"}]",
185
+ "reasoning": null,
186
+ "search": null,
187
+ "metadata": null,
188
+ "model": null,
189
+ "provider": null,
190
+ "favorite": false,
191
+ "error": null,
192
+ "tools": null,
193
+ "traceId": null,
194
+ "observationId": null,
195
+ "clientId": null,
196
+ "sessionId": null,
197
+ "topicId": "tpc_PJGbygbVl43e",
198
+ "threadId": null,
199
+ "parentId": "msg_VIS6XFukgdjLdL",
200
+ "quotaId": null,
201
+ "agentId": null,
202
+ "accessedAt": "2025-03-05T09:27:49.981Z",
203
+ "createdAt": "2025-03-05T09:27:49.981Z",
204
+ "updatedAt": "2025-03-05T09:27:49.981Z"
205
+ },
206
+ {
207
+ "id": "msg_UXX3vNnUTXRmy4",
208
+ "role": "user",
209
+ "content": "现在它的发展如何",
210
+ "reasoning": null,
211
+ "search": null,
212
+ "metadata": null,
213
+ "model": null,
214
+ "provider": null,
215
+ "favorite": false,
216
+ "error": null,
217
+ "tools": null,
218
+ "traceId": null,
219
+ "observationId": null,
220
+ "clientId": null,
221
+ "sessionId": null,
222
+ "topicId": "tpc_PJGbygbVl43e",
223
+ "threadId": null,
224
+ "parentId": null,
225
+ "quotaId": null,
226
+ "agentId": null,
227
+ "accessedAt": "2025-03-05T09:29:41.284Z",
228
+ "createdAt": "2025-03-05T09:29:41.284Z",
229
+ "updatedAt": "2025-03-05T09:29:41.284Z"
230
+ }
231
+ ],
232
+ "sessions": [
233
+ {
234
+ "id": "ssn_WdL6m1mReqyb",
235
+ "slug": "inbox",
236
+ "title": null,
237
+ "description": null,
238
+ "avatar": null,
239
+ "backgroundColor": null,
240
+ "type": "agent",
241
+ "groupId": null,
242
+ "clientId": null,
243
+ "pinned": false,
244
+ "accessedAt": "2025-03-05T05:25:44.521Z",
245
+ "createdAt": "2025-03-05T05:25:44.528Z",
246
+ "updatedAt": "2025-03-05T05:25:44.528Z"
247
+ }
248
+ ],
249
+ "topics": [
250
+ {
251
+ "id": "tpc_PJGbygbVl43e",
252
+ "title": "ABC规模查询",
253
+ "favorite": false,
254
+ "sessionId": null,
255
+ "clientId": null,
256
+ "historySummary": "用户想要了解ABC的公司规模",
257
+ "metadata": {
258
+ "model": "gpt-4o-mini",
259
+ "provider": "openai"
260
+ },
261
+ "accessedAt": "2025-03-05T06:55:46.808Z",
262
+ "createdAt": "2025-03-05T06:55:46.808Z",
263
+ "updatedAt": "2025-03-05T09:32:14.622Z"
264
+ }
265
+ ]
266
+ },
267
+ "mode": "pglite",
268
+ "schemaHash": "89e91285be422d5f44511c7405f57b57f8dfda4f0304126ae9b0f266e5fd60f1"
269
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "data": {
3
+ "userSettings": [
4
+ {
5
+ "id": "DEFAULT_LOBE_CHAT_USER",
6
+ "tts": {},
7
+ "keyVaults": null,
8
+ "general": { "fontSize": 12 },
9
+ "languageModel": {},
10
+ "systemAgent": {},
11
+ "defaultAgent": {},
12
+ "tool": {}
13
+ }
14
+ ]
15
+ },
16
+ "mode": "pglite",
17
+ "schemaHash": "89e91285be422d5f44511c7405f57b57f8dfda4f0304126ae9b0f266e5fd60f1"
18
+ }