@lobehub/lobehub 2.0.0-next.95 → 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 (267) hide show
  1. package/CHANGELOG.md +58 -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 +18 -0
  6. package/locales/ar/common.json +21 -0
  7. package/locales/ar/hotkey.json +4 -0
  8. package/locales/ar/models.json +6 -0
  9. package/locales/bg-BG/common.json +21 -0
  10. package/locales/bg-BG/hotkey.json +4 -0
  11. package/locales/bg-BG/models.json +6 -0
  12. package/locales/de-DE/common.json +21 -0
  13. package/locales/de-DE/hotkey.json +4 -0
  14. package/locales/de-DE/models.json +6 -0
  15. package/locales/en-US/common.json +21 -0
  16. package/locales/en-US/hotkey.json +4 -0
  17. package/locales/en-US/models.json +6 -0
  18. package/locales/es-ES/common.json +21 -0
  19. package/locales/es-ES/hotkey.json +4 -0
  20. package/locales/es-ES/models.json +6 -0
  21. package/locales/fa-IR/common.json +21 -0
  22. package/locales/fa-IR/hotkey.json +4 -0
  23. package/locales/fa-IR/models.json +6 -0
  24. package/locales/fr-FR/common.json +21 -0
  25. package/locales/fr-FR/hotkey.json +4 -0
  26. package/locales/fr-FR/models.json +6 -0
  27. package/locales/it-IT/common.json +21 -0
  28. package/locales/it-IT/hotkey.json +4 -0
  29. package/locales/it-IT/models.json +6 -0
  30. package/locales/ja-JP/common.json +21 -0
  31. package/locales/ja-JP/hotkey.json +4 -0
  32. package/locales/ja-JP/models.json +6 -0
  33. package/locales/ko-KR/common.json +21 -0
  34. package/locales/ko-KR/hotkey.json +4 -0
  35. package/locales/ko-KR/models.json +6 -0
  36. package/locales/nl-NL/common.json +21 -0
  37. package/locales/nl-NL/hotkey.json +4 -0
  38. package/locales/nl-NL/models.json +6 -0
  39. package/locales/pl-PL/common.json +21 -0
  40. package/locales/pl-PL/hotkey.json +4 -0
  41. package/locales/pl-PL/models.json +6 -0
  42. package/locales/pt-BR/common.json +21 -0
  43. package/locales/pt-BR/hotkey.json +4 -0
  44. package/locales/pt-BR/models.json +6 -0
  45. package/locales/ru-RU/common.json +21 -0
  46. package/locales/ru-RU/hotkey.json +4 -0
  47. package/locales/ru-RU/models.json +6 -0
  48. package/locales/tr-TR/common.json +21 -0
  49. package/locales/tr-TR/hotkey.json +4 -0
  50. package/locales/tr-TR/models.json +6 -0
  51. package/locales/vi-VN/common.json +21 -0
  52. package/locales/vi-VN/hotkey.json +4 -0
  53. package/locales/vi-VN/models.json +6 -0
  54. package/locales/zh-CN/common.json +21 -0
  55. package/locales/zh-CN/hotkey.json +4 -0
  56. package/locales/zh-CN/models.json +6 -0
  57. package/locales/zh-TW/common.json +21 -0
  58. package/locales/zh-TW/hotkey.json +4 -0
  59. package/locales/zh-TW/models.json +6 -0
  60. package/package.json +3 -1
  61. package/packages/const/src/hotkeys.ts +6 -0
  62. package/packages/conversation-flow/src/__tests__/indexing.test.ts +513 -0
  63. package/packages/conversation-flow/src/__tests__/structuring.test.ts +600 -0
  64. package/packages/database/src/client/db.ts +12 -12
  65. package/packages/database/src/repositories/dataImporter/index.ts +10 -10
  66. package/packages/database/src/schemas/topic.ts +1 -1
  67. package/packages/database/src/server/models/ragEval/evaluation.ts +1 -1
  68. package/packages/types/src/hotkey.ts +1 -0
  69. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/ClassicChat.tsx +1 -1
  70. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/GroupChat.tsx +1 -1
  71. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/ChatItem/index.tsx +1 -1
  72. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/Content.tsx +2 -2
  73. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/index.tsx +1 -1
  74. package/src/app/[variants]/(main)/chat/components/conversation/features/ChatMinimap/index.tsx +1 -1
  75. package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +41 -8
  76. package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +6 -4
  77. package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/index.tsx +16 -4
  78. package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +15 -3
  79. package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +23 -15
  80. package/src/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx +1 -1
  81. package/src/components/InvalidAPIKey/APIKeyForm/ComfyUIForm.tsx +1 -1
  82. package/src/components/InvalidAPIKey/APIKeyForm/ProviderApiKeyForm.tsx +1 -1
  83. package/src/components/InvalidAPIKey/APIKeyForm/__tests__/ComfyUIForm.test.tsx +1 -1
  84. package/src/components/InvalidAPIKey/index.tsx +1 -1
  85. package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.test.ts +1 -2
  86. package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/index.tsx +2 -2
  87. package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.test.tsx +3 -3
  88. package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.tsx +6 -5
  89. package/src/features/{Conversation → ChatList}/Messages/Assistant/MessageContent.tsx +1 -1
  90. package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithContentId.tsx +2 -2
  91. package/src/features/{Conversation → ChatList}/Messages/Group/ContentBlock.tsx +2 -2
  92. package/src/features/{Conversation → ChatList}/Messages/Group/Error/index.tsx +2 -1
  93. package/src/features/{Conversation → ChatList}/Messages/Group/Group.tsx +1 -1
  94. package/src/features/{Conversation → ChatList}/Messages/Group/GroupItem.tsx +3 -2
  95. package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ApprovalActions.tsx +1 -1
  96. package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/index.tsx +1 -2
  97. package/src/features/{Conversation → ChatList}/Messages/Group/index.tsx +1 -1
  98. package/src/features/{Conversation → ChatList}/Messages/User/Extra.tsx +3 -3
  99. package/src/features/{Conversation → ChatList}/Messages/User/index.tsx +1 -1
  100. package/src/features/{Conversation → ChatList}/Messages/index.tsx +1 -1
  101. package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/Preview.tsx +1 -1
  102. package/src/features/{Conversation → ChatList}/components/SkeletonList.tsx +1 -1
  103. package/src/features/{Conversation → ChatList}/components/VirtualizedList/index.tsx +1 -1
  104. package/src/features/OllamaSetupGuide/index.tsx +1 -1
  105. package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
  106. package/src/features/Portal/GroupThread/Body/ThreadChatItem.tsx +1 -1
  107. package/src/features/Portal/GroupThread/Body/ThreadChatList.tsx +1 -1
  108. package/src/features/Portal/Thread/Chat/ChatInput/index.tsx +1 -1
  109. package/src/features/Portal/Thread/Chat/ChatItem.tsx +1 -1
  110. package/src/features/Portal/Thread/Chat/ChatList.tsx +1 -1
  111. package/src/features/Portal/Thread/Chat/index.tsx +1 -1
  112. package/src/features/ShareModal/ShareImage/ChatList/index.tsx +1 -1
  113. package/src/layout/GlobalProvider/Cmdk.tsx +470 -0
  114. package/src/layout/GlobalProvider/CmdkLazy.tsx +17 -0
  115. package/src/layout/GlobalProvider/index.tsx +2 -0
  116. package/src/locales/default/common.ts +21 -0
  117. package/src/locales/default/hotkey.ts +4 -0
  118. package/src/services/debug.ts +4 -4
  119. package/src/services/electron/remoteServer.ts +5 -5
  120. package/src/services/electron/settings.ts +6 -6
  121. package/src/services/mcp.ts +18 -18
  122. package/src/services/models.ts +20 -20
  123. /package/src/features/{Conversation → ChatList}/Error/AccessCodeForm.tsx +0 -0
  124. /package/src/features/{Conversation → ChatList}/Error/ChatInvalidApiKey.tsx +0 -0
  125. /package/src/features/{Conversation → ChatList}/Error/ClerkLogin/index.tsx +0 -0
  126. /package/src/features/{Conversation → ChatList}/Error/ErrorJsonViewer.tsx +0 -0
  127. /package/src/features/{Conversation → ChatList}/Error/OAuthForm.tsx +0 -0
  128. /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/InvalidOllamaModel.tsx +0 -0
  129. /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/index.tsx +0 -0
  130. /package/src/features/{Conversation → ChatList}/Error/index.tsx +0 -0
  131. /package/src/features/{Conversation → ChatList}/Error/style.tsx +0 -0
  132. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/Icon.tsx +0 -0
  133. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/index.tsx +0 -0
  134. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/index.ts +0 -0
  135. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.test.ts +0 -0
  136. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.ts +0 -0
  137. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/Render.tsx +0 -0
  138. /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/index.ts +0 -0
  139. /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/Render/index.tsx +0 -0
  140. /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/index.ts +0 -0
  141. /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/Render.tsx +0 -0
  142. /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/index.ts +0 -0
  143. /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/Render.tsx +0 -0
  144. /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/index.ts +0 -0
  145. /package/src/features/{Conversation → ChatList}/MarkdownElements/index.ts +0 -0
  146. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/__snapshots__/createRemarkSelfClosingTagPlugin.test.ts.snap +0 -0
  147. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagPlugin.ts +0 -0
  148. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts +0 -0
  149. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.test.ts +0 -0
  150. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.ts +0 -0
  151. /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.ts +0 -0
  152. /package/src/features/{Conversation → ChatList}/MarkdownElements/type.ts +0 -0
  153. /package/src/features/{Conversation → ChatList}/MarkdownElements/utils.ts +0 -0
  154. /package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/Error.tsx +0 -0
  155. /package/src/features/{Conversation → ChatList}/Messages/Assistant/CollapsedMessage.tsx +0 -0
  156. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/index.tsx +0 -0
  157. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/style.ts +0 -0
  158. /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/index.tsx +0 -0
  159. /package/src/features/{Conversation → ChatList}/Messages/Assistant/IntentUnderstanding.tsx +0 -0
  160. /package/src/features/{Conversation → ChatList}/Messages/Assistant/Reasoning/index.tsx +0 -0
  161. /package/src/features/{Conversation → ChatList}/Messages/Assistant/SearchGrounding.tsx +0 -0
  162. /package/src/features/{Conversation → ChatList}/Messages/Assistant/index.tsx +0 -0
  163. /package/src/features/{Conversation → ChatList}/Messages/Default.tsx +0 -0
  164. /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithoutContentId.tsx +0 -0
  165. /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/index.tsx +0 -0
  166. /package/src/features/{Conversation → ChatList}/Messages/Group/CollapsedMessage.tsx +0 -0
  167. /package/src/features/{Conversation → ChatList}/Messages/Group/EditState.tsx +0 -0
  168. /package/src/features/{Conversation → ChatList}/Messages/Group/GroupContext.ts +0 -0
  169. /package/src/features/{Conversation → ChatList}/Messages/Group/MessageContent.tsx +0 -0
  170. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
  171. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Debug.tsx +0 -0
  172. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginResult.tsx +0 -0
  173. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginState.tsx +0 -0
  174. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Settings.tsx +0 -0
  175. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/StatusIndicator.tsx +0 -0
  176. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/ToolTitle.tsx +0 -0
  177. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/index.tsx +0 -0
  178. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/AbortResponse.tsx +0 -0
  179. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
  180. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ValueCell.tsx +0 -0
  181. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/index.tsx +0 -0
  182. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/CustomRender.tsx +0 -0
  183. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/ErrorResponse.tsx +0 -0
  184. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/Fallback.tsx +0 -0
  185. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/KeyValueEditor.tsx +0 -0
  186. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ModeSelector.tsx +0 -0
  187. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/index.tsx +0 -0
  188. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/LoadingPlaceholder/index.tsx +0 -0
  189. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/PluginSettings.tsx +0 -0
  190. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/RejectedResponse.tsx +0 -0
  191. /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/index.tsx +0 -0
  192. /package/src/features/{Conversation → ChatList}/Messages/Group/Tools.tsx +0 -0
  193. /package/src/features/{Conversation → ChatList}/Messages/Supervisor/TodoList.tsx +0 -0
  194. /package/src/features/{Conversation → ChatList}/Messages/Supervisor/index.tsx +0 -0
  195. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
  196. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Debug.tsx +0 -0
  197. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginResult.tsx +0 -0
  198. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginState.tsx +0 -0
  199. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Settings.tsx +0 -0
  200. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/ToolTitle.tsx +0 -0
  201. /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/index.tsx +0 -0
  202. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
  203. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ValueCell.tsx +0 -0
  204. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/index.tsx +0 -0
  205. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/CustomRender.tsx +0 -0
  206. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/ErrorResponse.tsx +0 -0
  207. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/KeyValueEditor.tsx +0 -0
  208. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/PluginSettings.tsx +0 -0
  209. /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/index.tsx +0 -0
  210. /package/src/features/{Conversation → ChatList}/Messages/Tool/ToolItem.tsx +0 -0
  211. /package/src/features/{Conversation → ChatList}/Messages/Tool/index.tsx +0 -0
  212. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/ActionsBar.tsx +0 -0
  213. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/MessageBranch.tsx +0 -0
  214. /package/src/features/{Conversation → ChatList}/Messages/User/Actions/index.tsx +0 -0
  215. /package/src/features/{Conversation → ChatList}/Messages/User/BelowMessage.tsx +0 -0
  216. /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/Item.tsx +0 -0
  217. /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/index.tsx +0 -0
  218. /package/src/features/{Conversation → ChatList}/Messages/User/ImageFileListViewer.tsx +0 -0
  219. /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/ContentPreview.tsx +0 -0
  220. /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/index.tsx +0 -0
  221. /package/src/features/{Conversation → ChatList}/Messages/User/MessageContent.tsx +0 -0
  222. /package/src/features/{Conversation → ChatList}/Messages/User/VideoFileListViewer.tsx +0 -0
  223. /package/src/features/{Conversation → ChatList}/components/AutoScroll.tsx +0 -0
  224. /package/src/features/{Conversation → ChatList}/components/BackBottom/index.tsx +0 -0
  225. /package/src/features/{Conversation → ChatList}/components/BackBottom/style.ts +0 -0
  226. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/PdfPreview.tsx +0 -0
  227. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/index.tsx +0 -0
  228. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/style.ts +0 -0
  229. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/template.ts +0 -0
  230. /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/usePdfGeneration.ts +0 -0
  231. /package/src/features/{Conversation → ChatList}/components/Extras/ExtraContainer.tsx +0 -0
  232. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/FilePlayer.tsx +0 -0
  233. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/InitPlayer.tsx +0 -0
  234. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/Player.tsx +0 -0
  235. /package/src/features/{Conversation → ChatList}/components/Extras/TTS/index.tsx +0 -0
  236. /package/src/features/{Conversation → ChatList}/components/Extras/Translate.tsx +0 -0
  237. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/AnimatedNumber.tsx +0 -0
  238. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/ModelCard.tsx +0 -0
  239. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/TokenProgress.tsx +0 -0
  240. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/index.tsx +0 -0
  241. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/pricing.ts +0 -0
  242. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.test.ts +0 -0
  243. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.ts +0 -0
  244. /package/src/features/{Conversation → ChatList}/components/Extras/Usage/index.tsx +0 -0
  245. /package/src/features/{Conversation → ChatList}/components/History/HistoryDivider.tsx +0 -0
  246. /package/src/features/{Conversation → ChatList}/components/History/index.tsx +0 -0
  247. /package/src/features/{Conversation → ChatList}/components/OTPInput.tsx +0 -0
  248. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/index.tsx +0 -0
  249. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/style.ts +0 -0
  250. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/type.ts +0 -0
  251. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/Preview.tsx +0 -0
  252. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/index.tsx +0 -0
  253. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.test.ts +0 -0
  254. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.ts +0 -0
  255. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/type.ts +0 -0
  256. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/index.tsx +0 -0
  257. /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/style.ts +0 -0
  258. /package/src/features/{Conversation → ChatList}/components/ThreadDivider/index.tsx +0 -0
  259. /package/src/features/{Conversation → ChatList}/components/VirtualizedList/VirtuosoContext.ts +0 -0
  260. /package/src/features/{Conversation → ChatList}/components/WideScreenContainer/index.tsx +0 -0
  261. /package/src/features/{Conversation → ChatList}/context/InPortalThreadContext.ts +0 -0
  262. /package/src/features/{Conversation → ChatList}/hooks/useChatListActionsBar.tsx +0 -0
  263. /package/src/features/{Conversation → ChatList}/hooks/useDoubleClickEdit.ts +0 -0
  264. /package/src/features/{Conversation → ChatList}/index.ts +0 -0
  265. /package/src/features/{Conversation → ChatList}/types/index.ts +0 -0
  266. /package/src/features/{Conversation → ChatList}/utils/markdown.test.ts +0 -0
  267. /package/src/features/{Conversation → ChatList}/utils/markdown.ts +0 -0
@@ -135,6 +135,27 @@
135
135
  }
136
136
  },
137
137
  "close": "關閉",
138
+ "cmdk": {
139
+ "about": "關於",
140
+ "communitySupport": "社群支援",
141
+ "discover": "探索",
142
+ "knowledgeBase": "知識庫",
143
+ "navigate": "導覽",
144
+ "newAgent": "新增助手",
145
+ "noResults": "未找到相關結果",
146
+ "openSettings": "開啟設定",
147
+ "painting": "AI 繪圖",
148
+ "searchPlaceholder": "輸入指令或搜尋...",
149
+ "settings": "設定",
150
+ "starOnGitHub": "在 GitHub 上給我們星標",
151
+ "submitIssue": "提交問題",
152
+ "theme": "主題",
153
+ "themeAuto": "依系統設定",
154
+ "themeDark": "深色模式",
155
+ "themeLight": "淺色模式",
156
+ "toOpen": "開啟",
157
+ "toSelect": "選取"
158
+ },
138
159
  "confirm": "確認",
139
160
  "contact": "聯繫我們",
140
161
  "copy": "複製",
@@ -7,6 +7,10 @@
7
7
  "desc": "清空當前會話的消息和上傳的檔案",
8
8
  "title": "清空會話消息"
9
9
  },
10
+ "commandPalette": {
11
+ "desc": "開啟全域指令面板以快速存取功能",
12
+ "title": "指令面板"
13
+ },
10
14
  "deleteAndRegenerateMessage": {
11
15
  "desc": "刪除最後一則訊息並重新產生",
12
16
  "title": "刪除並重新產生"
@@ -1907,6 +1907,12 @@
1907
1907
  "grok-4-0709": {
1908
1908
  "description": "xAI 的 Grok 4,具備強大的推理能力。"
1909
1909
  },
1910
+ "grok-4-1-fast-non-reasoning": {
1911
+ "description": "前沿多模態模型,專為高效能代理工具調用進行優化。"
1912
+ },
1913
+ "grok-4-1-fast-reasoning": {
1914
+ "description": "前沿多模態模型,專為高效能代理工具調用進行優化。"
1915
+ },
1910
1916
  "grok-4-fast-non-reasoning": {
1911
1917
  "description": "我們很高興發布 Grok 4 Fast,這是我們在成本效益推理模型方面的最新進展。"
1912
1918
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.95",
3
+ "version": "2.0.0-next.97",
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",
@@ -197,6 +197,7 @@
197
197
  "antd-style": "^3.7.1",
198
198
  "brotli-wasm": "^3.0.1",
199
199
  "chroma-js": "^3.1.2",
200
+ "cmdk": "^1.1.1",
200
201
  "cookie": "^1.0.2",
201
202
  "countries-and-timezones": "^3.8.0",
202
203
  "dayjs": "^1.11.19",
@@ -256,6 +257,7 @@
256
257
  "pwa-install-handler": "^2.6.3",
257
258
  "query-string": "^9.3.1",
258
259
  "random-words": "^2.0.1",
260
+ "rc-util": "^5.44.4",
259
261
  "react": "19.2.0",
260
262
  "react-confetti": "^6.4.0",
261
263
  "react-diff-view": "^3.3.2",
@@ -15,6 +15,12 @@ export type HotkeyRegistration = HotkeyItem[];
15
15
  // mod is the command key on Mac, alt is the ctrl key on Windows
16
16
  export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
17
17
  // basic
18
+ {
19
+ group: HotkeyGroupEnum.Essential,
20
+ id: HotkeyEnum.CommandPalette,
21
+ keys: combineKeys([KeyEnum.Mod, 'j']),
22
+ scopes: [HotkeyScopeEnum.Global],
23
+ },
18
24
  {
19
25
  group: HotkeyGroupEnum.Essential,
20
26
  id: HotkeyEnum.Search,
@@ -0,0 +1,513 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import { buildHelperMaps } from '../indexing';
4
+ import type { Message, MessageGroupMetadata } from '../types';
5
+
6
+ describe('buildHelperMaps', () => {
7
+ describe('messageMap', () => {
8
+ it('should build messageMap for O(1) access', () => {
9
+ const messages: Message[] = [
10
+ {
11
+ content: 'Hello',
12
+ createdAt: 1000,
13
+ id: 'msg-1',
14
+ meta: {},
15
+ role: 'user',
16
+ updatedAt: 1000,
17
+ },
18
+ {
19
+ content: 'Hi there',
20
+ createdAt: 2000,
21
+ id: 'msg-2',
22
+ meta: {},
23
+ parentId: 'msg-1',
24
+ role: 'assistant',
25
+ updatedAt: 2000,
26
+ },
27
+ ];
28
+
29
+ const result = buildHelperMaps(messages);
30
+
31
+ expect(result.messageMap.size).toBe(2);
32
+ expect(result.messageMap.get('msg-1')).toEqual(messages[0]);
33
+ expect(result.messageMap.get('msg-2')).toEqual(messages[1]);
34
+ });
35
+
36
+ it('should handle empty messages array', () => {
37
+ const result = buildHelperMaps([]);
38
+
39
+ expect(result.messageMap.size).toBe(0);
40
+ });
41
+
42
+ it('should handle single message', () => {
43
+ const messages: Message[] = [
44
+ {
45
+ content: 'Single message',
46
+ createdAt: 1000,
47
+ id: 'msg-1',
48
+ meta: {},
49
+ role: 'user',
50
+ updatedAt: 1000,
51
+ },
52
+ ];
53
+
54
+ const result = buildHelperMaps(messages);
55
+
56
+ expect(result.messageMap.size).toBe(1);
57
+ expect(result.messageMap.get('msg-1')).toEqual(messages[0]);
58
+ });
59
+ });
60
+
61
+ describe('childrenMap', () => {
62
+ it('should build childrenMap for parent-child relationships', () => {
63
+ const messages: Message[] = [
64
+ {
65
+ content: 'Root',
66
+ createdAt: 1000,
67
+ id: 'msg-1',
68
+ meta: {},
69
+ role: 'user',
70
+ updatedAt: 1000,
71
+ },
72
+ {
73
+ content: 'Child 1',
74
+ createdAt: 2000,
75
+ id: 'msg-2',
76
+ meta: {},
77
+ parentId: 'msg-1',
78
+ role: 'assistant',
79
+ updatedAt: 2000,
80
+ },
81
+ {
82
+ content: 'Child 2',
83
+ createdAt: 3000,
84
+ id: 'msg-3',
85
+ meta: {},
86
+ parentId: 'msg-1',
87
+ role: 'assistant',
88
+ updatedAt: 3000,
89
+ },
90
+ ];
91
+
92
+ const result = buildHelperMaps(messages);
93
+
94
+ expect(result.childrenMap.get(null)).toEqual(['msg-1']);
95
+ expect(result.childrenMap.get('msg-1')).toEqual(['msg-2', 'msg-3']);
96
+ });
97
+
98
+ it('should handle messages with no parent (root messages)', () => {
99
+ const messages: Message[] = [
100
+ {
101
+ content: 'Root 1',
102
+ createdAt: 1000,
103
+ id: 'msg-1',
104
+ meta: {},
105
+ role: 'user',
106
+ updatedAt: 1000,
107
+ },
108
+ {
109
+ content: 'Root 2',
110
+ createdAt: 2000,
111
+ id: 'msg-2',
112
+ meta: {},
113
+ role: 'user',
114
+ updatedAt: 2000,
115
+ },
116
+ ];
117
+
118
+ const result = buildHelperMaps(messages);
119
+
120
+ expect(result.childrenMap.get(null)).toEqual(['msg-1', 'msg-2']);
121
+ });
122
+
123
+ it('should handle deeply nested parent-child relationships', () => {
124
+ const messages: Message[] = [
125
+ {
126
+ content: 'Level 0',
127
+ createdAt: 1000,
128
+ id: 'msg-1',
129
+ meta: {},
130
+ role: 'user',
131
+ updatedAt: 1000,
132
+ },
133
+ {
134
+ content: 'Level 1',
135
+ createdAt: 2000,
136
+ id: 'msg-2',
137
+ meta: {},
138
+ parentId: 'msg-1',
139
+ role: 'assistant',
140
+ updatedAt: 2000,
141
+ },
142
+ {
143
+ content: 'Level 2',
144
+ createdAt: 3000,
145
+ id: 'msg-3',
146
+ meta: {},
147
+ parentId: 'msg-2',
148
+ role: 'user',
149
+ updatedAt: 3000,
150
+ },
151
+ {
152
+ content: 'Level 3',
153
+ createdAt: 4000,
154
+ id: 'msg-4',
155
+ meta: {},
156
+ parentId: 'msg-3',
157
+ role: 'assistant',
158
+ updatedAt: 4000,
159
+ },
160
+ ];
161
+
162
+ const result = buildHelperMaps(messages);
163
+
164
+ expect(result.childrenMap.get(null)).toEqual(['msg-1']);
165
+ expect(result.childrenMap.get('msg-1')).toEqual(['msg-2']);
166
+ expect(result.childrenMap.get('msg-2')).toEqual(['msg-3']);
167
+ expect(result.childrenMap.get('msg-3')).toEqual(['msg-4']);
168
+ });
169
+
170
+ it('should handle branching conversations', () => {
171
+ const messages: Message[] = [
172
+ {
173
+ content: 'Root',
174
+ createdAt: 1000,
175
+ id: 'msg-1',
176
+ meta: {},
177
+ role: 'user',
178
+ updatedAt: 1000,
179
+ },
180
+ {
181
+ content: 'Branch 1',
182
+ createdAt: 2000,
183
+ id: 'msg-2',
184
+ meta: {},
185
+ parentId: 'msg-1',
186
+ role: 'assistant',
187
+ updatedAt: 2000,
188
+ },
189
+ {
190
+ content: 'Branch 2',
191
+ createdAt: 3000,
192
+ id: 'msg-3',
193
+ meta: {},
194
+ parentId: 'msg-1',
195
+ role: 'assistant',
196
+ updatedAt: 3000,
197
+ },
198
+ {
199
+ content: 'Sub-branch 1',
200
+ createdAt: 4000,
201
+ id: 'msg-4',
202
+ meta: {},
203
+ parentId: 'msg-2',
204
+ role: 'user',
205
+ updatedAt: 4000,
206
+ },
207
+ {
208
+ content: 'Sub-branch 2',
209
+ createdAt: 5000,
210
+ id: 'msg-5',
211
+ meta: {},
212
+ parentId: 'msg-2',
213
+ role: 'user',
214
+ updatedAt: 5000,
215
+ },
216
+ ];
217
+
218
+ const result = buildHelperMaps(messages);
219
+
220
+ expect(result.childrenMap.get(null)).toEqual(['msg-1']);
221
+ expect(result.childrenMap.get('msg-1')).toEqual(['msg-2', 'msg-3']);
222
+ expect(result.childrenMap.get('msg-2')).toEqual(['msg-4', 'msg-5']);
223
+ });
224
+ });
225
+
226
+ describe('threadMap', () => {
227
+ it('should build threadMap for messages with threadId', () => {
228
+ const messages: Message[] = [
229
+ {
230
+ content: 'Main message',
231
+ createdAt: 1000,
232
+ id: 'msg-1',
233
+ meta: {},
234
+ role: 'user',
235
+ updatedAt: 1000,
236
+ },
237
+ {
238
+ content: 'Thread message 1',
239
+ createdAt: 2000,
240
+ id: 'msg-2',
241
+ meta: {},
242
+ parentId: 'msg-1',
243
+ role: 'assistant',
244
+ threadId: 'thread-1',
245
+ updatedAt: 2000,
246
+ },
247
+ {
248
+ content: 'Thread message 2',
249
+ createdAt: 3000,
250
+ id: 'msg-3',
251
+ meta: {},
252
+ parentId: 'msg-2',
253
+ role: 'user',
254
+ threadId: 'thread-1',
255
+ updatedAt: 3000,
256
+ },
257
+ ];
258
+
259
+ const result = buildHelperMaps(messages);
260
+
261
+ expect(result.threadMap.size).toBe(1);
262
+ expect(result.threadMap.get('thread-1')).toHaveLength(2);
263
+ expect(result.threadMap.get('thread-1')).toEqual([messages[1], messages[2]]);
264
+ });
265
+
266
+ it('should handle multiple threads', () => {
267
+ const messages: Message[] = [
268
+ {
269
+ content: 'Thread 1 - msg 1',
270
+ createdAt: 1000,
271
+ id: 'msg-1',
272
+ meta: {},
273
+ role: 'user',
274
+ threadId: 'thread-1',
275
+ updatedAt: 1000,
276
+ },
277
+ {
278
+ content: 'Thread 1 - msg 2',
279
+ createdAt: 2000,
280
+ id: 'msg-2',
281
+ meta: {},
282
+ role: 'assistant',
283
+ threadId: 'thread-1',
284
+ updatedAt: 2000,
285
+ },
286
+ {
287
+ content: 'Thread 2 - msg 1',
288
+ createdAt: 3000,
289
+ id: 'msg-3',
290
+ meta: {},
291
+ role: 'user',
292
+ threadId: 'thread-2',
293
+ updatedAt: 3000,
294
+ },
295
+ ];
296
+
297
+ const result = buildHelperMaps(messages);
298
+
299
+ expect(result.threadMap.size).toBe(2);
300
+ expect(result.threadMap.get('thread-1')).toEqual([messages[0], messages[1]]);
301
+ expect(result.threadMap.get('thread-2')).toEqual([messages[2]]);
302
+ });
303
+
304
+ it('should not include messages without threadId in threadMap', () => {
305
+ const messages: Message[] = [
306
+ {
307
+ content: 'No thread',
308
+ createdAt: 1000,
309
+ id: 'msg-1',
310
+ meta: {},
311
+ role: 'user',
312
+ updatedAt: 1000,
313
+ },
314
+ {
315
+ content: 'With thread',
316
+ createdAt: 2000,
317
+ id: 'msg-2',
318
+ meta: {},
319
+ role: 'assistant',
320
+ threadId: 'thread-1',
321
+ updatedAt: 2000,
322
+ },
323
+ ];
324
+
325
+ const result = buildHelperMaps(messages);
326
+
327
+ expect(result.threadMap.size).toBe(1);
328
+ expect(result.threadMap.get('thread-1')).toEqual([messages[1]]);
329
+ });
330
+
331
+ it('should handle empty threadMap when no messages have threadId', () => {
332
+ const messages: Message[] = [
333
+ {
334
+ content: 'Message 1',
335
+ createdAt: 1000,
336
+ id: 'msg-1',
337
+ meta: {},
338
+ role: 'user',
339
+ updatedAt: 1000,
340
+ },
341
+ {
342
+ content: 'Message 2',
343
+ createdAt: 2000,
344
+ id: 'msg-2',
345
+ meta: {},
346
+ role: 'assistant',
347
+ updatedAt: 2000,
348
+ },
349
+ ];
350
+
351
+ const result = buildHelperMaps(messages);
352
+
353
+ expect(result.threadMap.size).toBe(0);
354
+ });
355
+ });
356
+
357
+ describe('messageGroupMap', () => {
358
+ it('should build messageGroupMap from provided metadata', () => {
359
+ const messages: Message[] = [
360
+ {
361
+ content: 'Message',
362
+ createdAt: 1000,
363
+ id: 'msg-1',
364
+ meta: {},
365
+ role: 'user',
366
+ updatedAt: 1000,
367
+ },
368
+ ];
369
+
370
+ const messageGroups: MessageGroupMetadata[] = [
371
+ {
372
+ id: 'group-1',
373
+ mode: 'compare',
374
+ },
375
+ {
376
+ id: 'group-2',
377
+ mode: 'summary',
378
+ },
379
+ ];
380
+
381
+ const result = buildHelperMaps(messages, messageGroups);
382
+
383
+ expect(result.messageGroupMap.size).toBe(2);
384
+ expect(result.messageGroupMap.get('group-1')).toEqual(messageGroups[0]);
385
+ expect(result.messageGroupMap.get('group-2')).toEqual(messageGroups[1]);
386
+ });
387
+
388
+ it('should handle empty messageGroupMap when no metadata provided', () => {
389
+ const messages: Message[] = [
390
+ {
391
+ content: 'Message',
392
+ createdAt: 1000,
393
+ id: 'msg-1',
394
+ meta: {},
395
+ role: 'user',
396
+ updatedAt: 1000,
397
+ },
398
+ ];
399
+
400
+ const result = buildHelperMaps(messages);
401
+
402
+ expect(result.messageGroupMap.size).toBe(0);
403
+ });
404
+
405
+ it('should handle empty messageGroupMap when empty array provided', () => {
406
+ const messages: Message[] = [
407
+ {
408
+ content: 'Message',
409
+ createdAt: 1000,
410
+ id: 'msg-1',
411
+ meta: {},
412
+ role: 'user',
413
+ updatedAt: 1000,
414
+ },
415
+ ];
416
+
417
+ const result = buildHelperMaps(messages, []);
418
+
419
+ expect(result.messageGroupMap.size).toBe(0);
420
+ });
421
+ });
422
+
423
+ describe('integration scenarios', () => {
424
+ it('should build all maps correctly in complex conversation', () => {
425
+ const messages: Message[] = [
426
+ {
427
+ content: 'Root message',
428
+ createdAt: 1000,
429
+ id: 'msg-1',
430
+ meta: {},
431
+ role: 'user',
432
+ updatedAt: 1000,
433
+ },
434
+ {
435
+ content: 'Assistant response',
436
+ createdAt: 2000,
437
+ groupId: 'group-1',
438
+ id: 'msg-2',
439
+ meta: {},
440
+ parentId: 'msg-1',
441
+ role: 'assistant',
442
+ updatedAt: 2000,
443
+ },
444
+ {
445
+ content: 'Thread message',
446
+ createdAt: 3000,
447
+ id: 'msg-3',
448
+ meta: {},
449
+ parentId: 'msg-2',
450
+ role: 'user',
451
+ threadId: 'thread-1',
452
+ updatedAt: 3000,
453
+ },
454
+ {
455
+ content: 'Branch message',
456
+ createdAt: 4000,
457
+ id: 'msg-4',
458
+ meta: {},
459
+ parentId: 'msg-1',
460
+ role: 'assistant',
461
+ updatedAt: 4000,
462
+ },
463
+ ];
464
+
465
+ const messageGroups: MessageGroupMetadata[] = [
466
+ {
467
+ id: 'group-1',
468
+ mode: 'compare',
469
+ },
470
+ ];
471
+
472
+ const result = buildHelperMaps(messages, messageGroups);
473
+
474
+ // Verify messageMap
475
+ expect(result.messageMap.size).toBe(4);
476
+
477
+ // Verify childrenMap
478
+ expect(result.childrenMap.get(null)).toEqual(['msg-1']);
479
+ expect(result.childrenMap.get('msg-1')).toEqual(['msg-2', 'msg-4']);
480
+ expect(result.childrenMap.get('msg-2')).toEqual(['msg-3']);
481
+
482
+ // Verify threadMap
483
+ expect(result.threadMap.size).toBe(1);
484
+ expect(result.threadMap.get('thread-1')).toEqual([messages[2]]);
485
+
486
+ // Verify messageGroupMap
487
+ expect(result.messageGroupMap.size).toBe(1);
488
+ expect(result.messageGroupMap.get('group-1')).toEqual(messageGroups[0]);
489
+ });
490
+
491
+ it('should handle large number of messages efficiently', () => {
492
+ const messages: Message[] = Array.from({ length: 1000 }, (_, i) => ({
493
+ content: `Message ${i}`,
494
+ createdAt: i,
495
+ id: `msg-${i}`,
496
+ meta: {},
497
+ parentId: i > 0 ? `msg-${i - 1}` : undefined,
498
+ role: i % 2 === 0 ? ('user' as const) : ('assistant' as const),
499
+ updatedAt: i,
500
+ }));
501
+
502
+ const startTime = performance.now();
503
+ const result = buildHelperMaps(messages);
504
+ const endTime = performance.now();
505
+
506
+ const executionTime = endTime - startTime;
507
+
508
+ expect(result.messageMap.size).toBe(1000);
509
+ expect(result.childrenMap.size).toBe(1000);
510
+ expect(executionTime).toBeLessThan(50); // Should be fast
511
+ });
512
+ });
513
+ });