@lobehub/lobehub 2.0.0-next.96 → 2.0.0-next.97

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 (217) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/apps/desktop/src/preload/index.ts +2 -2
  3. package/apps/desktop/src/preload/invoke.ts +1 -1
  4. package/apps/desktop/src/preload/routeInterceptor.ts +41 -41
  5. package/changelog/v1.json +9 -0
  6. package/locales/ar/models.json +6 -0
  7. package/locales/bg-BG/models.json +6 -0
  8. package/locales/de-DE/models.json +6 -0
  9. package/locales/en-US/models.json +6 -0
  10. package/locales/es-ES/models.json +6 -0
  11. package/locales/fa-IR/models.json +6 -0
  12. package/locales/fr-FR/models.json +6 -0
  13. package/locales/it-IT/models.json +6 -0
  14. package/locales/ja-JP/models.json +6 -0
  15. package/locales/ko-KR/models.json +6 -0
  16. package/locales/nl-NL/models.json +6 -0
  17. package/locales/pl-PL/models.json +6 -0
  18. package/locales/pt-BR/models.json +6 -0
  19. package/locales/ru-RU/models.json +6 -0
  20. package/locales/tr-TR/models.json +6 -0
  21. package/locales/vi-VN/models.json +6 -0
  22. package/locales/zh-CN/models.json +6 -0
  23. package/locales/zh-TW/models.json +6 -0
  24. package/package.json +1 -1
  25. package/packages/database/src/client/db.ts +12 -12
  26. package/packages/database/src/repositories/dataImporter/index.ts +10 -10
  27. package/packages/database/src/schemas/topic.ts +1 -1
  28. package/packages/database/src/server/models/ragEval/evaluation.ts +1 -1
  29. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/ClassicChat.tsx +1 -1
  30. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/GroupChat.tsx +1 -1
  31. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/ChatItem/index.tsx +1 -1
  32. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/Content.tsx +2 -2
  33. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/index.tsx +1 -1
  34. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatMinimap/index.tsx +1 -1
  35. package/src/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx +1 -1
  36. package/src/components/InvalidAPIKey/APIKeyForm/ComfyUIForm.tsx +1 -1
  37. package/src/components/InvalidAPIKey/APIKeyForm/ProviderApiKeyForm.tsx +1 -1
  38. package/src/components/InvalidAPIKey/APIKeyForm/__tests__/ComfyUIForm.test.tsx +1 -1
  39. package/src/components/InvalidAPIKey/index.tsx +1 -1
  40. package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.test.ts +1 -2
  41. package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/index.tsx +2 -2
  42. package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.test.tsx +3 -3
  43. package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.tsx +6 -5
  44. package/src/features/{Conversation → ChatList}/Messages/Assistant/MessageContent.tsx +1 -1
  45. package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithContentId.tsx +2 -2
  46. package/src/features/{Conversation → ChatList}/Messages/Group/ContentBlock.tsx +2 -2
  47. package/src/features/{Conversation → ChatList}/Messages/Group/Error/index.tsx +2 -1
  48. package/src/features/{Conversation → ChatList}/Messages/Group/Group.tsx +1 -1
  49. package/src/features/{Conversation → ChatList}/Messages/Group/GroupItem.tsx +3 -2
  50. package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ApprovalActions.tsx +1 -1
  51. package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/index.tsx +1 -2
  52. package/src/features/{Conversation → ChatList}/Messages/Group/index.tsx +1 -1
  53. package/src/features/{Conversation → ChatList}/Messages/User/Extra.tsx +3 -3
  54. package/src/features/{Conversation → ChatList}/Messages/User/index.tsx +1 -1
  55. package/src/features/{Conversation → ChatList}/Messages/index.tsx +1 -1
  56. package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/Preview.tsx +1 -1
  57. package/src/features/{Conversation → ChatList}/components/SkeletonList.tsx +1 -1
  58. package/src/features/{Conversation → ChatList}/components/VirtualizedList/index.tsx +1 -1
  59. package/src/features/OllamaSetupGuide/index.tsx +1 -1
  60. package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
  61. package/src/features/Portal/GroupThread/Body/ThreadChatItem.tsx +1 -1
  62. package/src/features/Portal/GroupThread/Body/ThreadChatList.tsx +1 -1
  63. package/src/features/Portal/Thread/Chat/ChatInput/index.tsx +1 -1
  64. package/src/features/Portal/Thread/Chat/ChatItem.tsx +1 -1
  65. package/src/features/Portal/Thread/Chat/ChatList.tsx +1 -1
  66. package/src/features/Portal/Thread/Chat/index.tsx +1 -1
  67. package/src/features/ShareModal/ShareImage/ChatList/index.tsx +1 -1
  68. package/src/services/debug.ts +4 -4
  69. package/src/services/electron/remoteServer.ts +5 -5
  70. package/src/services/electron/settings.ts +6 -6
  71. package/src/services/mcp.ts +18 -18
  72. package/src/services/models.ts +20 -20
  73. /package/src/features/{Conversation → ChatList}/Error/AccessCodeForm.tsx +0 -0
  74. /package/src/features/{Conversation → ChatList}/Error/ChatInvalidApiKey.tsx +0 -0
  75. /package/src/features/{Conversation → ChatList}/Error/ClerkLogin/index.tsx +0 -0
  76. /package/src/features/{Conversation → ChatList}/Error/ErrorJsonViewer.tsx +0 -0
  77. /package/src/features/{Conversation → ChatList}/Error/OAuthForm.tsx +0 -0
  78. /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/InvalidOllamaModel.tsx +0 -0
  79. /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/index.tsx +0 -0
  80. /package/src/features/{Conversation → ChatList}/Error/index.tsx +0 -0
  81. /package/src/features/{Conversation → ChatList}/Error/style.tsx +0 -0
  82. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/Icon.tsx +0 -0
  83. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/index.tsx +0 -0
  84. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/index.ts +0 -0
  85. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.test.ts +0 -0
  86. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.ts +0 -0
  87. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/Render.tsx +0 -0
  88. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/index.ts +0 -0
  89. /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/Render/index.tsx +0 -0
  90. /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/index.ts +0 -0
  91. /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/Render.tsx +0 -0
  92. /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/index.ts +0 -0
  93. /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/Render.tsx +0 -0
  94. /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/index.ts +0 -0
  95. /package/src/features/{Conversation → ChatList}/MarkdownElements/index.ts +0 -0
  96. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/__snapshots__/createRemarkSelfClosingTagPlugin.test.ts.snap +0 -0
  97. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagPlugin.ts +0 -0
  98. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts +0 -0
  99. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.test.ts +0 -0
  100. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.ts +0 -0
  101. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.ts +0 -0
  102. /package/src/features/{Conversation → ChatList}/MarkdownElements/type.ts +0 -0
  103. /package/src/features/{Conversation → ChatList}/MarkdownElements/utils.ts +0 -0
  104. /package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/Error.tsx +0 -0
  105. /package/src/features/{Conversation → ChatList}/Messages/Assistant/CollapsedMessage.tsx +0 -0
  106. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/index.tsx +0 -0
  107. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/style.ts +0 -0
  108. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/index.tsx +0 -0
  109. /package/src/features/{Conversation → ChatList}/Messages/Assistant/IntentUnderstanding.tsx +0 -0
  110. /package/src/features/{Conversation → ChatList}/Messages/Assistant/Reasoning/index.tsx +0 -0
  111. /package/src/features/{Conversation → ChatList}/Messages/Assistant/SearchGrounding.tsx +0 -0
  112. /package/src/features/{Conversation → ChatList}/Messages/Assistant/index.tsx +0 -0
  113. /package/src/features/{Conversation → ChatList}/Messages/Default.tsx +0 -0
  114. /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithoutContentId.tsx +0 -0
  115. /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/index.tsx +0 -0
  116. /package/src/features/{Conversation → ChatList}/Messages/Group/CollapsedMessage.tsx +0 -0
  117. /package/src/features/{Conversation → ChatList}/Messages/Group/EditState.tsx +0 -0
  118. /package/src/features/{Conversation → ChatList}/Messages/Group/GroupContext.ts +0 -0
  119. /package/src/features/{Conversation → ChatList}/Messages/Group/MessageContent.tsx +0 -0
  120. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
  121. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Debug.tsx +0 -0
  122. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginResult.tsx +0 -0
  123. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginState.tsx +0 -0
  124. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Settings.tsx +0 -0
  125. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/StatusIndicator.tsx +0 -0
  126. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/ToolTitle.tsx +0 -0
  127. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/index.tsx +0 -0
  128. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/AbortResponse.tsx +0 -0
  129. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
  130. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ValueCell.tsx +0 -0
  131. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/index.tsx +0 -0
  132. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/CustomRender.tsx +0 -0
  133. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/ErrorResponse.tsx +0 -0
  134. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/Fallback.tsx +0 -0
  135. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/KeyValueEditor.tsx +0 -0
  136. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ModeSelector.tsx +0 -0
  137. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/index.tsx +0 -0
  138. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/LoadingPlaceholder/index.tsx +0 -0
  139. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/PluginSettings.tsx +0 -0
  140. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/RejectedResponse.tsx +0 -0
  141. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/index.tsx +0 -0
  142. /package/src/features/{Conversation → ChatList}/Messages/Group/Tools.tsx +0 -0
  143. /package/src/features/{Conversation → ChatList}/Messages/Supervisor/TodoList.tsx +0 -0
  144. /package/src/features/{Conversation → ChatList}/Messages/Supervisor/index.tsx +0 -0
  145. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
  146. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Debug.tsx +0 -0
  147. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginResult.tsx +0 -0
  148. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginState.tsx +0 -0
  149. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Settings.tsx +0 -0
  150. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/ToolTitle.tsx +0 -0
  151. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/index.tsx +0 -0
  152. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
  153. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ValueCell.tsx +0 -0
  154. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/index.tsx +0 -0
  155. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/CustomRender.tsx +0 -0
  156. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/ErrorResponse.tsx +0 -0
  157. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/KeyValueEditor.tsx +0 -0
  158. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/PluginSettings.tsx +0 -0
  159. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/index.tsx +0 -0
  160. /package/src/features/{Conversation → ChatList}/Messages/Tool/ToolItem.tsx +0 -0
  161. /package/src/features/{Conversation → ChatList}/Messages/Tool/index.tsx +0 -0
  162. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/ActionsBar.tsx +0 -0
  163. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/MessageBranch.tsx +0 -0
  164. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/index.tsx +0 -0
  165. /package/src/features/{Conversation → ChatList}/Messages/User/BelowMessage.tsx +0 -0
  166. /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/Item.tsx +0 -0
  167. /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/index.tsx +0 -0
  168. /package/src/features/{Conversation → ChatList}/Messages/User/ImageFileListViewer.tsx +0 -0
  169. /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/ContentPreview.tsx +0 -0
  170. /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/index.tsx +0 -0
  171. /package/src/features/{Conversation → ChatList}/Messages/User/MessageContent.tsx +0 -0
  172. /package/src/features/{Conversation → ChatList}/Messages/User/VideoFileListViewer.tsx +0 -0
  173. /package/src/features/{Conversation → ChatList}/components/AutoScroll.tsx +0 -0
  174. /package/src/features/{Conversation → ChatList}/components/BackBottom/index.tsx +0 -0
  175. /package/src/features/{Conversation → ChatList}/components/BackBottom/style.ts +0 -0
  176. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/PdfPreview.tsx +0 -0
  177. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/index.tsx +0 -0
  178. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/style.ts +0 -0
  179. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/template.ts +0 -0
  180. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/usePdfGeneration.ts +0 -0
  181. /package/src/features/{Conversation → ChatList}/components/Extras/ExtraContainer.tsx +0 -0
  182. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/FilePlayer.tsx +0 -0
  183. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/InitPlayer.tsx +0 -0
  184. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/Player.tsx +0 -0
  185. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/index.tsx +0 -0
  186. /package/src/features/{Conversation → ChatList}/components/Extras/Translate.tsx +0 -0
  187. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/AnimatedNumber.tsx +0 -0
  188. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/ModelCard.tsx +0 -0
  189. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/TokenProgress.tsx +0 -0
  190. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/index.tsx +0 -0
  191. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/pricing.ts +0 -0
  192. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.test.ts +0 -0
  193. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.ts +0 -0
  194. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/index.tsx +0 -0
  195. /package/src/features/{Conversation → ChatList}/components/History/HistoryDivider.tsx +0 -0
  196. /package/src/features/{Conversation → ChatList}/components/History/index.tsx +0 -0
  197. /package/src/features/{Conversation → ChatList}/components/OTPInput.tsx +0 -0
  198. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/index.tsx +0 -0
  199. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/style.ts +0 -0
  200. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/type.ts +0 -0
  201. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/Preview.tsx +0 -0
  202. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/index.tsx +0 -0
  203. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.test.ts +0 -0
  204. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.ts +0 -0
  205. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/type.ts +0 -0
  206. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/index.tsx +0 -0
  207. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/style.ts +0 -0
  208. /package/src/features/{Conversation → ChatList}/components/ThreadDivider/index.tsx +0 -0
  209. /package/src/features/{Conversation → ChatList}/components/VirtualizedList/VirtuosoContext.ts +0 -0
  210. /package/src/features/{Conversation → ChatList}/components/WideScreenContainer/index.tsx +0 -0
  211. /package/src/features/{Conversation → ChatList}/context/InPortalThreadContext.ts +0 -0
  212. /package/src/features/{Conversation → ChatList}/hooks/useChatListActionsBar.tsx +0 -0
  213. /package/src/features/{Conversation → ChatList}/hooks/useDoubleClickEdit.ts +0 -0
  214. /package/src/features/{Conversation → ChatList}/index.ts +0 -0
  215. /package/src/features/{Conversation → ChatList}/types/index.ts +0 -0
  216. /package/src/features/{Conversation → ChatList}/utils/markdown.test.ts +0 -0
  217. /package/src/features/{Conversation → ChatList}/utils/markdown.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { Suspense, memo } from 'react';
2
2
  import { Flexbox } from 'react-layout-kit';
3
3
 
4
- import { SkeletonList } from '@/features/Conversation';
4
+ import { SkeletonList } from '@/features/ChatList';
5
5
 
6
6
  import ChatInput from './ChatInput';
7
7
  import ChatList from './ChatList';
@@ -1,7 +1,7 @@
1
1
  import { memo } from 'react';
2
2
  import { Flexbox } from 'react-layout-kit';
3
3
 
4
- import { ChatItem } from '@/features/Conversation';
4
+ import { ChatItem } from '@/features/ChatList';
5
5
  import { useChatStore } from '@/store/chat';
6
6
  import { chatSelectors } from '@/store/chat/selectors';
7
7
 
@@ -7,7 +7,7 @@ class DebugService {
7
7
  // topicCount: 200,
8
8
  // });
9
9
  //
10
- // console.log('已插入10w');
10
+ // console.log('Inserted 100k');
11
11
  //
12
12
  // await DEBUG_MODEL.createRandomData({
13
13
  // messageCount: 300_000,
@@ -15,7 +15,7 @@ class DebugService {
15
15
  // startIndex: 100_001,
16
16
  // topicCount: 200,
17
17
  // });
18
- // console.log('已插入40w');
18
+ // console.log('Inserted 400k');
19
19
  //
20
20
  // await DEBUG_MODEL.createRandomData({
21
21
  // messageCount: 300_000,
@@ -23,7 +23,7 @@ class DebugService {
23
23
  // startIndex: 400_001,
24
24
  // topicCount: 200,
25
25
  // });
26
- // console.log('已插入70w');
26
+ // console.log('Inserted 700k');
27
27
  //
28
28
  // await DEBUG_MODEL.createRandomData({
29
29
  // messageCount: 300_000,
@@ -31,7 +31,7 @@ class DebugService {
31
31
  // startIndex: 700_001,
32
32
  // topicCount: 200,
33
33
  // });
34
- // console.log('已插入100w');
34
+ // console.log('Inserted 1M');
35
35
  }
36
36
  }
37
37
 
@@ -2,35 +2,35 @@ import { DataSyncConfig, MarketAuthorizationParams, dispatch } from '@lobechat/e
2
2
 
3
3
  class RemoteServerService {
4
4
  /**
5
- * 获取远程服务器配置
5
+ * Get remote server configuration
6
6
  */
7
7
  getRemoteServerConfig = async () => {
8
8
  return dispatch('getRemoteServerConfig');
9
9
  };
10
10
 
11
11
  /**
12
- * 设置远程服务器配置
12
+ * Set remote server configuration
13
13
  */
14
14
  setRemoteServerConfig = async (config: DataSyncConfig) => {
15
15
  return dispatch('setRemoteServerConfig', config);
16
16
  };
17
17
 
18
18
  /**
19
- * 清除远程服务器配置
19
+ * Clear remote server configuration
20
20
  */
21
21
  clearRemoteServerConfig = async () => {
22
22
  return dispatch('clearRemoteServerConfig');
23
23
  };
24
24
 
25
25
  /**
26
- * 请求授权
26
+ * Request authorization
27
27
  */
28
28
  requestAuthorization = async (config: DataSyncConfig) => {
29
29
  return dispatch('requestAuthorization', config);
30
30
  };
31
31
 
32
32
  /**
33
- * 请求 Market 授权
33
+ * Request Market authorization
34
34
  */
35
35
  requestMarketAuthorization = async (params: MarketAuthorizationParams) => {
36
36
  return dispatch('requestMarketAuthorization', params);
@@ -6,42 +6,42 @@ import {
6
6
 
7
7
  class DesktopSettingsService {
8
8
  /**
9
- * 获取远程服务器配置
9
+ * Get proxy settings
10
10
  */
11
11
  getProxySettings = async () => {
12
12
  return dispatch('getProxySettings');
13
13
  };
14
14
 
15
15
  /**
16
- * 设置远程服务器配置
16
+ * Set proxy settings
17
17
  */
18
18
  setSettings = async (data: Partial<NetworkProxySettings>) => {
19
19
  return dispatch('setProxySettings', data);
20
20
  };
21
21
 
22
22
  /**
23
- * 获取桌面热键配置
23
+ * Get desktop hotkey configuration
24
24
  */
25
25
  getDesktopHotkeys = async () => {
26
26
  return dispatch('getShortcutsConfig');
27
27
  };
28
28
 
29
29
  /**
30
- * 更新桌面热键配置
30
+ * Update desktop hotkey configuration
31
31
  */
32
32
  updateDesktopHotkey = async (id: string, accelerator: string): Promise<ShortcutUpdateResult> => {
33
33
  return dispatch('updateShortcutConfig', { accelerator, id });
34
34
  };
35
35
 
36
36
  /**
37
- * 测试代理连接
37
+ * Test proxy connection
38
38
  */
39
39
  testProxyConnection = async (url: string) => {
40
40
  return dispatch('testProxyConnection', url);
41
41
  };
42
42
 
43
43
  /**
44
- * 测试指定的代理配置
44
+ * Test specified proxy configuration
45
45
  */
46
46
  testProxyConfig = async (config: NetworkProxySettings, testUrl?: string) => {
47
47
  return dispatch('testProxyConfig', { config, testUrl });
@@ -10,9 +10,9 @@ import { desktopClient, toolsClient } from '@/libs/trpc/client';
10
10
  import { discoverService } from './discover';
11
11
 
12
12
  /**
13
- * 计算对象的字节大小
14
- * @param obj 要计算大小的对象
15
- * @returns 字节大小
13
+ * Calculate byte size of object
14
+ * @param obj Object to calculate size of
15
+ * @returns Byte size
16
16
  */
17
17
  function calculateObjectSizeBytes(obj: any): number {
18
18
  try {
@@ -85,7 +85,7 @@ class MCPService {
85
85
 
86
86
  const isStdio = plugin?.customParams?.mcp?.type === 'stdio';
87
87
 
88
- // 记录调用开始时间
88
+ // Record call start time
89
89
  const callStartTime = Date.now();
90
90
  let success = false;
91
91
  let errorCode: string | undefined;
@@ -108,22 +108,22 @@ class MCPService {
108
108
  errorCode = 'CALL_FAILED';
109
109
  errorMessage = err.message;
110
110
 
111
- // 重新抛出错误,保持原有的错误处理逻辑
111
+ // Rethrow error, maintain original error handling logic
112
112
  throw error;
113
113
  } finally {
114
- // 异步上报调用结果,不影响主流程
114
+ // Asynchronously report call result without affecting main flow
115
115
  const callEndTime = Date.now();
116
116
  const callDurationMs = callEndTime - callStartTime;
117
117
 
118
- // 计算请求大小
118
+ // Calculate request size
119
119
  const inputParams = safeParseJSON(args) || args;
120
120
 
121
121
  const requestSizeBytes = calculateObjectSizeBytes(inputParams);
122
- // 计算响应大小
122
+ // Calculate response size
123
123
  const responseSizeBytes = success && result ? calculateObjectSizeBytes(result.state) : 0;
124
124
 
125
125
  const isCustomPlugin = !!customPlugin;
126
- // 构造上报数据
126
+ // Construct report data
127
127
  const reportData: CallReportRequest = {
128
128
  callDurationMs,
129
129
  customPluginInfo: isCustomPlugin
@@ -151,7 +151,7 @@ class MCPService {
151
151
  version: plugin.manifest!.version || 'unknown',
152
152
  };
153
153
 
154
- // 异步上报,不影响主流程
154
+ // Asynchronously report without affecting main flow
155
155
  discoverService.reportPluginCall(reportData).catch((reportError) => {
156
156
  console.warn('Failed to report MCP tool call:', reportError);
157
157
  });
@@ -172,13 +172,13 @@ class MCPService {
172
172
  },
173
173
  signal?: AbortSignal,
174
174
  ) {
175
- // 如果是 Desktop 模式且 URL 是本地地址,使用 desktopClient
176
- // 这样可以避免在生产环境中通过远程服务器访问用户本地服务
175
+ // If in Desktop mode and URL is local address, use desktopClient
176
+ // This avoids accessing user local services through remote server in production
177
177
  if (isDesktop && isLocalOrPrivateUrl(params.url)) {
178
178
  return desktopClient.mcp.getStreamableMcpServerManifest.query(params, { signal });
179
179
  }
180
180
 
181
- // 否则使用 toolsClient(通过服务器中转)
181
+ // Otherwise use toolsClient (via server relay)
182
182
  return toolsClient.mcp.getStreamableMcpServerManifest.query(params, { signal });
183
183
  }
184
184
 
@@ -199,16 +199,16 @@ class MCPService {
199
199
  }
200
200
 
201
201
  /**
202
- * 检查 MCP 插件安装状态
203
- * @param manifest MCP 插件清单
204
- * @param signal AbortSignal 用于取消请求
205
- * @returns 安装检测结果
202
+ * Check MCP plugin installation status
203
+ * @param manifest MCP plugin manifest
204
+ * @param signal AbortSignal for canceling request
205
+ * @returns Installation check result
206
206
  */
207
207
  async checkInstallation(
208
208
  manifest: PluginManifest,
209
209
  signal?: AbortSignal,
210
210
  ): Promise<CheckMcpInstallResult> {
211
- // 将所有部署选项传递给主进程进行检查
211
+ // Pass all deployment options to main process for checking
212
212
  return desktopClient.mcp.validMcpServerInstallable.mutate(
213
213
  { deploymentOptions: manifest.deploymentOptions as any },
214
214
  { signal },
@@ -11,7 +11,7 @@ import { resolveRuntimeProvider } from './chat/helper';
11
11
  const isEnableFetchOnClient = (provider: string) =>
12
12
  aiProviderSelectors.isProviderFetchOnClient(provider)(getAiInfraStoreState());
13
13
 
14
- // 进度信息接口
14
+ // Progress information interface
15
15
  export interface ModelProgressInfo {
16
16
  completed?: number;
17
17
  digest?: string;
@@ -20,15 +20,15 @@ export interface ModelProgressInfo {
20
20
  total?: number;
21
21
  }
22
22
 
23
- // 进度回调函数类型
23
+ // Progress callback function type
24
24
  export type ProgressCallback = (progress: ModelProgressInfo) => void;
25
25
  export type ErrorCallback = (error: { message: string }) => void;
26
26
 
27
27
  export class ModelsService {
28
- // 用于中断下载的控制器
28
+ // Controller for aborting downloads
29
29
  private _abortController: AbortController | null = null;
30
30
 
31
- // 获取模型列表
31
+ // Get model list
32
32
  getModels = async (provider: string): Promise<ChatModelCard[] | undefined> => {
33
33
  const headers = await createHeaderWithAuth({
34
34
  headers: { 'Content-Type': 'application/json' },
@@ -59,14 +59,14 @@ export class ModelsService {
59
59
  };
60
60
 
61
61
  /**
62
- * 下载模型并通过回调函数返回进度信息
62
+ * Download model and return progress info through callback
63
63
  */
64
64
  downloadModel = async (
65
65
  { model, provider }: { model: string; provider: string },
66
66
  { onProgress }: { onError?: ErrorCallback; onProgress?: ProgressCallback } = {},
67
67
  ): Promise<void> => {
68
68
  try {
69
- // 创建一个新的 AbortController
69
+ // Create a new AbortController
70
70
  this._abortController = new AbortController();
71
71
  const signal = this._abortController.signal;
72
72
 
@@ -99,12 +99,12 @@ export class ModelsService {
99
99
  throw await getMessageError(res);
100
100
  }
101
101
 
102
- // 处理响应流
102
+ // Process response stream
103
103
  if (res.body) {
104
104
  await this.processModelPullStream(res, { onProgress });
105
105
  }
106
106
  } catch (error) {
107
- // 如果是取消操作,不需要继续抛出错误
107
+ // If operation is canceled, no need to continue throwing error
108
108
  if (error instanceof DOMException && error.name === 'AbortError') {
109
109
  return;
110
110
  }
@@ -112,14 +112,14 @@ export class ModelsService {
112
112
  console.error('download model error:', error);
113
113
  throw error;
114
114
  } finally {
115
- // 清理 AbortController
115
+ // Clean up AbortController
116
116
  this._abortController = null;
117
117
  }
118
118
  };
119
119
 
120
- // 中断模型下载
120
+ // Abort model download
121
121
  abortPull = () => {
122
- // 使用 AbortController 中断下载
122
+ // Use AbortController to abort download
123
123
  if (this._abortController) {
124
124
  this._abortController.abort();
125
125
  this._abortController = null;
@@ -127,28 +127,28 @@ export class ModelsService {
127
127
  };
128
128
 
129
129
  /**
130
- * 处理模型下载流,解析进度信息并通过回调函数返回
131
- * @param response 响应对象
132
- * @param onProgress 进度回调函数
130
+ * Process model download stream, parse progress info and return via callback
131
+ * @param response Response object
132
+ * @param onProgress Progress callback function
133
133
  * @returns Promise<void>
134
134
  */
135
135
  private processModelPullStream = async (
136
136
  response: Response,
137
137
  { onProgress, onError }: { onError?: ErrorCallback; onProgress?: ProgressCallback },
138
138
  ): Promise<void> => {
139
- // 处理响应流
139
+ // Process response stream
140
140
  const reader = response.body?.getReader();
141
141
  if (!reader) return;
142
142
 
143
- // 读取和处理流数据
143
+ // Read and process stream data
144
144
  // eslint-disable-next-line no-constant-condition
145
145
  while (true) {
146
146
  const { done, value } = await reader.read();
147
147
  if (done) break;
148
148
 
149
- // 解析进度数据
149
+ // Parse progress data
150
150
  const progressText = new TextDecoder().decode(value);
151
- // 一行可能包含多个进度更新
151
+ // One line may contain multiple progress updates
152
152
  const progressUpdates = progressText.trim().split('\n');
153
153
 
154
154
  for (const update of progressUpdates) {
@@ -161,7 +161,7 @@ export class ModelsService {
161
161
  }
162
162
 
163
163
  if (progress.status === 'canceled') {
164
- console.log('progress', progress);
164
+ console.log('progress:', progress);
165
165
  // const abortError = new Error('abort');
166
166
  // abortError.name = 'AbortError';
167
167
  //
@@ -173,7 +173,7 @@ export class ModelsService {
173
173
  throw new Error(progress.error);
174
174
  }
175
175
 
176
- // 调用进度回调
176
+ // Call progress callback
177
177
  if (progress.completed !== undefined || progress.status) {
178
178
  onProgress?.(progress);
179
179
  }