@lobehub/chat 1.17.6 → 1.18.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.

Potentially problematic release.


This version of @lobehub/chat might be problematic. Click here for more details.

Files changed (339) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/locales/ar/common.json +1 -1
  3. package/locales/ar/discover.json +204 -0
  4. package/locales/ar/metadata.json +20 -3
  5. package/locales/ar/models.json +845 -0
  6. package/locales/ar/providers.json +80 -0
  7. package/locales/bg-BG/common.json +1 -1
  8. package/locales/bg-BG/discover.json +204 -0
  9. package/locales/bg-BG/metadata.json +20 -3
  10. package/locales/bg-BG/models.json +845 -0
  11. package/locales/bg-BG/providers.json +80 -0
  12. package/locales/de-DE/common.json +1 -1
  13. package/locales/de-DE/discover.json +204 -0
  14. package/locales/de-DE/metadata.json +20 -3
  15. package/locales/de-DE/models.json +845 -0
  16. package/locales/de-DE/providers.json +80 -0
  17. package/locales/en-US/common.json +1 -1
  18. package/locales/en-US/discover.json +204 -0
  19. package/locales/en-US/metadata.json +20 -3
  20. package/locales/en-US/models.json +845 -0
  21. package/locales/en-US/providers.json +80 -0
  22. package/locales/es-ES/common.json +1 -1
  23. package/locales/es-ES/discover.json +204 -0
  24. package/locales/es-ES/metadata.json +20 -3
  25. package/locales/es-ES/models.json +845 -0
  26. package/locales/es-ES/providers.json +80 -0
  27. package/locales/fr-FR/common.json +1 -1
  28. package/locales/fr-FR/discover.json +204 -0
  29. package/locales/fr-FR/metadata.json +20 -3
  30. package/locales/fr-FR/models.json +845 -0
  31. package/locales/fr-FR/providers.json +80 -0
  32. package/locales/it-IT/common.json +1 -1
  33. package/locales/it-IT/discover.json +204 -0
  34. package/locales/it-IT/metadata.json +20 -3
  35. package/locales/it-IT/models.json +845 -0
  36. package/locales/it-IT/providers.json +80 -0
  37. package/locales/ja-JP/common.json +1 -1
  38. package/locales/ja-JP/discover.json +204 -0
  39. package/locales/ja-JP/metadata.json +20 -3
  40. package/locales/ja-JP/models.json +845 -0
  41. package/locales/ja-JP/providers.json +80 -0
  42. package/locales/ko-KR/common.json +1 -1
  43. package/locales/ko-KR/discover.json +204 -0
  44. package/locales/ko-KR/metadata.json +20 -3
  45. package/locales/ko-KR/models.json +845 -0
  46. package/locales/ko-KR/providers.json +80 -0
  47. package/locales/nl-NL/common.json +1 -1
  48. package/locales/nl-NL/discover.json +204 -0
  49. package/locales/nl-NL/metadata.json +20 -3
  50. package/locales/nl-NL/models.json +845 -0
  51. package/locales/nl-NL/providers.json +80 -0
  52. package/locales/pl-PL/common.json +1 -1
  53. package/locales/pl-PL/discover.json +204 -0
  54. package/locales/pl-PL/metadata.json +20 -3
  55. package/locales/pl-PL/models.json +845 -0
  56. package/locales/pl-PL/providers.json +80 -0
  57. package/locales/pt-BR/common.json +1 -1
  58. package/locales/pt-BR/discover.json +204 -0
  59. package/locales/pt-BR/metadata.json +20 -3
  60. package/locales/pt-BR/models.json +845 -0
  61. package/locales/pt-BR/providers.json +80 -0
  62. package/locales/ru-RU/common.json +1 -1
  63. package/locales/ru-RU/discover.json +204 -0
  64. package/locales/ru-RU/metadata.json +20 -3
  65. package/locales/ru-RU/models.json +845 -0
  66. package/locales/ru-RU/providers.json +80 -0
  67. package/locales/tr-TR/common.json +1 -1
  68. package/locales/tr-TR/discover.json +204 -0
  69. package/locales/tr-TR/metadata.json +20 -3
  70. package/locales/tr-TR/models.json +845 -0
  71. package/locales/tr-TR/providers.json +80 -0
  72. package/locales/vi-VN/common.json +1 -1
  73. package/locales/vi-VN/discover.json +204 -0
  74. package/locales/vi-VN/metadata.json +20 -3
  75. package/locales/vi-VN/models.json +845 -0
  76. package/locales/vi-VN/providers.json +80 -0
  77. package/locales/zh-CN/common.json +1 -1
  78. package/locales/zh-CN/discover.json +204 -0
  79. package/locales/zh-CN/metadata.json +20 -3
  80. package/locales/zh-CN/models.json +845 -0
  81. package/locales/zh-CN/providers.json +80 -0
  82. package/locales/zh-CN/welcome.json +1 -1
  83. package/locales/zh-TW/common.json +1 -1
  84. package/locales/zh-TW/discover.json +204 -0
  85. package/locales/zh-TW/metadata.json +20 -3
  86. package/locales/zh-TW/models.json +845 -0
  87. package/locales/zh-TW/providers.json +80 -0
  88. package/package.json +3 -2
  89. package/src/app/(main)/@nav/_layout/Desktop/TopActions.test.tsx +3 -3
  90. package/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +3 -3
  91. package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
  92. package/src/app/(main)/_layout/Mobile.tsx +9 -1
  93. package/src/app/(main)/discover/(detail)/_layout/Desktop.tsx +24 -0
  94. package/src/app/(main)/discover/(detail)/_layout/Mobile/Header.tsx +25 -0
  95. package/src/app/(main)/discover/(detail)/_layout/Mobile/index.tsx +17 -0
  96. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Actions.tsx +35 -0
  97. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/AddAgent.tsx +86 -0
  98. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/TopicList.tsx +74 -0
  99. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/index.tsx +100 -0
  100. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Header.tsx +118 -0
  101. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/SuggestionItem.tsx +62 -0
  102. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/ToolItem.tsx +19 -0
  103. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/index.tsx +64 -0
  104. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/SystemRole.tsx +35 -0
  105. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Temp.tsx +44 -0
  106. package/src/app/(main)/discover/(detail)/assistant/[slug]/page.tsx +121 -0
  107. package/src/app/(main)/discover/(detail)/error.tsx +5 -0
  108. package/src/app/(main)/discover/(detail)/features/Back.tsx +42 -0
  109. package/src/app/(main)/discover/(detail)/features/Block.tsx +50 -0
  110. package/src/app/(main)/discover/(detail)/features/DetailLayout.tsx +91 -0
  111. package/src/app/(main)/discover/(detail)/features/HighlightBlock.tsx +82 -0
  112. package/src/app/(main)/discover/(detail)/features/ShareButton.tsx +160 -0
  113. package/src/app/(main)/discover/(detail)/features/SidebarContainer.tsx +19 -0
  114. package/src/app/(main)/discover/(detail)/layout.tsx +12 -0
  115. package/src/app/(main)/discover/(detail)/loading.tsx +38 -0
  116. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Actions.tsx +46 -0
  117. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ChatWithModel.tsx +93 -0
  118. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Header.tsx +85 -0
  119. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/SuggestionItem.tsx +75 -0
  120. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/index.tsx +49 -0
  121. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ParameterList/ParameterItem.tsx +71 -0
  122. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ParameterList/index.tsx +110 -0
  123. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/ProviderItem.tsx +152 -0
  124. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/index.tsx +45 -0
  125. package/src/app/(main)/discover/(detail)/model/[...slugs]/page.tsx +114 -0
  126. package/src/app/(main)/discover/(detail)/not-found.tsx +3 -0
  127. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Actions.tsx +35 -0
  128. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Header.tsx +114 -0
  129. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/SuggestionItem.tsx +62 -0
  130. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/index.tsx +49 -0
  131. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InstallPlugin.tsx +87 -0
  132. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/ParameterList.tsx +95 -0
  133. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Schema.tsx +23 -0
  134. package/src/app/(main)/discover/(detail)/plugin/[slug]/page.tsx +103 -0
  135. package/src/app/(main)/discover/(detail)/provider/[slug]/features/Actions.tsx +49 -0
  136. package/src/app/(main)/discover/(detail)/provider/[slug]/features/Header.tsx +73 -0
  137. package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +75 -0
  138. package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/index.tsx +49 -0
  139. package/src/app/(main)/discover/(detail)/provider/[slug]/features/ModelList/ModelItem.tsx +148 -0
  140. package/src/app/(main)/discover/(detail)/provider/[slug]/features/ModelList/index.tsx +60 -0
  141. package/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx +80 -0
  142. package/src/app/(main)/discover/(detail)/provider/[slug]/page.tsx +116 -0
  143. package/src/app/(main)/discover/(list)/(home)/Client.tsx +42 -0
  144. package/src/app/(main)/discover/(list)/(home)/features/AssistantList.tsx +33 -0
  145. package/src/app/(main)/discover/(list)/(home)/features/ModelList.tsx +22 -0
  146. package/src/app/(main)/discover/(list)/(home)/features/PluginList.tsx +25 -0
  147. package/src/app/(main)/discover/(list)/(home)/loading.tsx +1 -0
  148. package/src/app/(main)/discover/(list)/(home)/page.tsx +54 -0
  149. package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +118 -0
  150. package/src/app/(main)/discover/(list)/_layout/Desktop/index.tsx +37 -0
  151. package/src/app/(main)/discover/(list)/_layout/Desktop/useScroll.ts +33 -0
  152. package/src/app/(main)/discover/(list)/_layout/Mobile/Header.tsx +62 -0
  153. package/src/app/(main)/discover/(list)/_layout/Mobile/Nav.tsx +94 -0
  154. package/src/app/(main)/discover/(list)/_layout/Mobile/index.tsx +27 -0
  155. package/src/app/(main)/discover/(list)/assistants/[slug]/page.tsx +64 -0
  156. package/src/app/(main)/discover/(list)/assistants/_layout/Desktop.tsx +22 -0
  157. package/src/app/(main)/discover/(list)/assistants/_layout/Mobile.tsx +9 -0
  158. package/src/app/(main)/discover/(list)/assistants/features/Card.tsx +176 -0
  159. package/src/app/(main)/discover/(list)/assistants/features/Category.tsx +48 -0
  160. package/src/app/(main)/discover/(list)/assistants/features/List.tsx +97 -0
  161. package/src/app/(main)/discover/(list)/assistants/features/useCategory.tsx +116 -0
  162. package/src/app/(main)/discover/(list)/assistants/layout.tsx +12 -0
  163. package/src/app/(main)/discover/(list)/assistants/loading.tsx +1 -0
  164. package/src/app/(main)/discover/(list)/assistants/page.tsx +51 -0
  165. package/src/app/(main)/discover/(list)/error.tsx +5 -0
  166. package/src/app/(main)/{market → discover/(list)}/layout.tsx +4 -3
  167. package/src/app/(main)/discover/(list)/loading.tsx +39 -0
  168. package/src/app/(main)/discover/(list)/models/[slug]/page.tsx +70 -0
  169. package/src/app/(main)/discover/(list)/models/_layout/Desktop.tsx +28 -0
  170. package/src/app/(main)/discover/(list)/models/_layout/Mobile.tsx +9 -0
  171. package/src/app/(main)/discover/(list)/models/features/Card.tsx +116 -0
  172. package/src/app/(main)/discover/(list)/models/features/Category.tsx +67 -0
  173. package/src/app/(main)/discover/(list)/models/features/List.tsx +72 -0
  174. package/src/app/(main)/discover/(list)/models/features/const.ts +9 -0
  175. package/src/app/(main)/discover/(list)/models/layout.tsx +12 -0
  176. package/src/app/(main)/discover/(list)/models/loading.tsx +1 -0
  177. package/src/app/(main)/discover/(list)/models/page.tsx +61 -0
  178. package/src/app/(main)/discover/(list)/not-found.tsx +3 -0
  179. package/src/app/(main)/discover/(list)/plugins/[slug]/page.tsx +64 -0
  180. package/src/app/(main)/discover/(list)/plugins/_layout/Desktop.tsx +22 -0
  181. package/src/app/(main)/discover/(list)/plugins/_layout/Mobile.tsx +9 -0
  182. package/src/app/(main)/discover/(list)/plugins/features/Card.tsx +154 -0
  183. package/src/app/(main)/discover/(list)/plugins/features/Category.tsx +45 -0
  184. package/src/app/(main)/discover/(list)/plugins/features/List.tsx +96 -0
  185. package/src/app/(main)/discover/(list)/plugins/features/useCategory.tsx +80 -0
  186. package/src/app/(main)/discover/(list)/plugins/layout.tsx +12 -0
  187. package/src/app/(main)/discover/(list)/plugins/loading.tsx +1 -0
  188. package/src/app/(main)/discover/(list)/plugins/page.tsx +52 -0
  189. package/src/app/(main)/discover/(list)/providers/features/Card.tsx +117 -0
  190. package/src/app/(main)/discover/(list)/providers/features/List.tsx +71 -0
  191. package/src/app/(main)/discover/(list)/providers/loading.tsx +1 -0
  192. package/src/app/(main)/discover/(list)/providers/page.tsx +52 -0
  193. package/src/app/(main)/discover/_layout/Desktop/Header.tsx +36 -0
  194. package/src/app/(main)/discover/_layout/Desktop/index.tsx +21 -0
  195. package/src/app/(main)/discover/_layout/Mobile/index.tsx +9 -0
  196. package/src/app/(main)/{market/features/AgentCard/AgentCardBanner.tsx → discover/components/CardBanner.tsx} +5 -5
  197. package/src/app/(main)/discover/components/CategoryContainer.tsx +18 -0
  198. package/src/app/(main)/discover/components/CategoryMenu.tsx +39 -0
  199. package/src/app/(main)/discover/components/GitHubAvatar.tsx +19 -0
  200. package/src/app/(main)/discover/components/GridLoadingCard.tsx +69 -0
  201. package/src/app/(main)/discover/components/ListLoading.tsx +66 -0
  202. package/src/app/(main)/discover/components/Loading.tsx +17 -0
  203. package/src/app/(main)/discover/components/SearchResultCount.tsx +37 -0
  204. package/src/app/(main)/discover/components/Statistic.tsx +92 -0
  205. package/src/app/(main)/discover/components/Title.tsx +76 -0
  206. package/src/app/(main)/discover/components/VirtuosoGridList/index.tsx +52 -0
  207. package/src/app/(main)/discover/components/VirtuosoGridList/useScrollParent.ts +19 -0
  208. package/src/app/(main)/discover/error.tsx +5 -0
  209. package/src/app/(main)/{market/features/ShareAgentButton → discover/features/CreateButton}/Inner.tsx +9 -10
  210. package/src/app/(main)/{market/features/ShareAgentButton → discover/features/CreateButton}/index.tsx +9 -9
  211. package/src/app/(main)/discover/features/LikeButton.tsx +73 -0
  212. package/src/app/(main)/discover/features/ModelFeatureTags.tsx +77 -0
  213. package/src/app/(main)/discover/features/StoreSearchBar.tsx +84 -0
  214. package/src/app/(main)/discover/features/const.ts +2 -0
  215. package/src/app/(main)/discover/features/useNav.tsx +71 -0
  216. package/src/app/(main)/discover/layout.tsx +12 -0
  217. package/src/app/(main)/discover/loading.tsx +9 -0
  218. package/src/app/(main)/discover/not-found.tsx +3 -0
  219. package/src/app/(main)/discover/search/_layout/Desktop.tsx +42 -0
  220. package/src/app/(main)/discover/search/_layout/Mobile/Header.tsx +31 -0
  221. package/src/app/(main)/discover/search/_layout/Mobile/Nav.tsx +56 -0
  222. package/src/app/(main)/discover/search/_layout/Mobile/index.tsx +32 -0
  223. package/src/app/(main)/discover/search/features/AssistantsResult.tsx +27 -0
  224. package/src/app/(main)/discover/search/features/Category.tsx +41 -0
  225. package/src/app/(main)/discover/search/features/ModelsResult.tsx +27 -0
  226. package/src/app/(main)/discover/search/features/PluginsResult.tsx +27 -0
  227. package/src/app/(main)/discover/search/features/ProvidersResult.tsx +26 -0
  228. package/src/app/(main)/discover/search/layout.tsx +12 -0
  229. package/src/app/(main)/discover/search/loading.tsx +1 -0
  230. package/src/app/(main)/discover/search/page.tsx +78 -0
  231. package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +0 -6
  232. package/src/app/(main)/welcome/features/Actions.tsx +1 -1
  233. package/src/app/@modal/(.)discover/assistant/[slug]/page.tsx +1 -0
  234. package/src/app/@modal/(.)discover/layout.tsx +29 -0
  235. package/src/app/@modal/(.)discover/loading.tsx +3 -0
  236. package/src/app/@modal/(.)discover/model/[...slugs]/page.tsx +1 -0
  237. package/src/app/@modal/(.)discover/plugin/[slug]/page.tsx +1 -0
  238. package/src/app/@modal/(.)discover/provider/[slug]/page.tsx +1 -0
  239. package/src/app/@modal/features/InterceptingContext.tsx +9 -0
  240. package/src/app/@modal/layout.tsx +58 -21
  241. package/src/app/api/{market → assistant}/[id]/route.ts +2 -3
  242. package/src/app/api/{market → assistant/store}/route.ts +2 -5
  243. package/src/app/api/plugin/store/route.ts +1 -4
  244. package/src/app/metadata.ts +3 -0
  245. package/src/app/redirect/page.tsx +15 -0
  246. package/src/components/FetchErrorNotification/Description.tsx +2 -0
  247. package/src/components/InterceptingLink/index.tsx +27 -0
  248. package/src/components/mdx/CodeBlock.tsx +46 -0
  249. package/src/components/mdx/Link.tsx +21 -0
  250. package/src/components/mdx/index.tsx +51 -0
  251. package/src/config/modelProviders/ollama.ts +0 -8
  252. package/src/const/discover.ts +63 -1
  253. package/src/features/Conversation/Error/PluginSettings.tsx +1 -1
  254. package/src/features/Conversation/Messages/Tool/Inspector/Settings.tsx +1 -1
  255. package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +41 -24
  256. package/src/features/MobileTabBar/index.tsx +3 -3
  257. package/src/features/PluginDetailModal/APIs.tsx +1 -1
  258. package/src/features/PluginDevModal/UrlManifestForm.tsx +1 -1
  259. package/src/features/PluginStore/PluginItem/Action.tsx +1 -1
  260. package/src/features/PluginsUI/Render/DefaultType/index.tsx +1 -1
  261. package/src/features/PluginsUI/Render/StandaloneType/index.tsx +1 -1
  262. package/src/hooks/useInterceptingRoutes.ts +21 -1
  263. package/src/hooks/useShare.tsx +191 -0
  264. package/src/libs/agent-runtime/utils/streams/openai.test.ts +43 -0
  265. package/src/libs/agent-runtime/utils/streams/openai.ts +1 -1
  266. package/src/locales/create.ts +1 -1
  267. package/src/locales/default/common.ts +1 -1
  268. package/src/locales/default/discover.ts +205 -0
  269. package/src/locales/default/index.ts +6 -2
  270. package/src/locales/default/metadata.ts +23 -3
  271. package/src/locales/default/models.ts +15 -0
  272. package/src/locales/default/providers.ts +15 -0
  273. package/src/locales/default/welcome.ts +1 -1
  274. package/src/locales/resources.ts +2 -0
  275. package/src/server/ld.ts +85 -11
  276. package/src/server/metadata.ts +41 -3
  277. package/src/{app/api/market/AgentMarket.test.ts → server/modules/AssistantStore/index.test.ts} +15 -15
  278. package/src/{app/api/market/AgentMarket.ts → server/modules/AssistantStore/index.ts} +7 -3
  279. package/src/{app/api/plugin/store/Store.test.ts → server/modules/PluginStore/index.test.ts} +1 -1
  280. package/src/server/services/discover/index.ts +352 -0
  281. package/src/server/services/doc/index.tsx +40 -0
  282. package/src/server/translation.ts +11 -5
  283. package/src/services/__tests__/__snapshots__/tool.test.ts.snap +1 -1
  284. package/src/services/{_auth.test.ts → __tests__/_auth.test.ts} +1 -1
  285. package/src/services/__tests__/assistant.test.ts +82 -0
  286. package/src/services/__tests__/tool.test.ts +13 -13
  287. package/src/services/_url.ts +2 -2
  288. package/src/services/assistant.ts +30 -0
  289. package/src/services/chat.ts +1 -1
  290. package/src/services/tool.ts +7 -129
  291. package/src/store/chat/slices/plugin/action.test.ts +112 -0
  292. package/src/store/chat/slices/plugin/action.ts +1 -3
  293. package/src/store/global/initialState.ts +1 -1
  294. package/src/store/tool/selectors/tool.test.ts +1 -1
  295. package/src/store/tool/slices/customPlugin/action.test.ts +1 -1
  296. package/src/store/tool/slices/customPlugin/action.ts +1 -1
  297. package/src/store/tool/slices/plugin/action.ts +1 -1
  298. package/src/store/tool/slices/plugin/selectors.test.ts +3 -3
  299. package/src/store/tool/slices/plugin/selectors.ts +3 -3
  300. package/src/store/tool/slices/store/action.test.ts +16 -22
  301. package/src/store/tool/slices/store/action.ts +8 -8
  302. package/src/types/discover.ts +152 -0
  303. package/src/types/llm.ts +4 -2
  304. package/src/types/meta.ts +1 -0
  305. package/src/utils/format.test.ts +191 -112
  306. package/src/utils/format.ts +36 -0
  307. package/src/utils/toolManifest.ts +124 -0
  308. package/src/app/(main)/market/@detail/default.tsx +0 -12
  309. package/src/app/(main)/market/@detail/features/AgentDetailContent.tsx +0 -73
  310. package/src/app/(main)/market/@detail/features/Banner.tsx +0 -46
  311. package/src/app/(main)/market/@detail/features/Comment.tsx +0 -16
  312. package/src/app/(main)/market/@detail/features/Header.tsx +0 -81
  313. package/src/app/(main)/market/@detail/features/Loading.tsx +0 -63
  314. package/src/app/(main)/market/@detail/features/TokenTag.tsx +0 -27
  315. package/src/app/(main)/market/@detail/features/style.ts +0 -32
  316. package/src/app/(main)/market/_layout/Desktop/DetailSidebar.tsx +0 -84
  317. package/src/app/(main)/market/_layout/Desktop/Header.tsx +0 -29
  318. package/src/app/(main)/market/_layout/Desktop/Hero.tsx +0 -40
  319. package/src/app/(main)/market/_layout/Desktop/index.tsx +0 -46
  320. package/src/app/(main)/market/_layout/Mobile/DetailModal.tsx +0 -32
  321. package/src/app/(main)/market/_layout/Mobile/Header.tsx +0 -20
  322. package/src/app/(main)/market/_layout/Mobile/index.tsx +0 -25
  323. package/src/app/(main)/market/_layout/type.ts +0 -6
  324. package/src/app/(main)/market/features/AgentCard/index.tsx +0 -139
  325. package/src/app/(main)/market/features/AgentList.tsx +0 -103
  326. package/src/app/(main)/market/features/AgentSearchBar.tsx +0 -42
  327. package/src/app/(main)/market/features/TagList.tsx +0 -69
  328. package/src/app/(main)/market/loading.tsx +0 -15
  329. package/src/app/(main)/market/page.tsx +0 -44
  330. package/src/const/market.ts +0 -15
  331. package/src/locales/default/market.ts +0 -32
  332. package/src/services/market.ts +0 -22
  333. package/src/store/market/action.ts +0 -82
  334. package/src/store/market/index.ts +0 -3
  335. package/src/store/market/initialState.ts +0 -19
  336. package/src/store/market/selectors.ts +0 -38
  337. package/src/store/market/store.ts +0 -48
  338. package/src/types/market.ts +0 -20
  339. /package/src/{app/api/plugin/store/Store.ts → server/modules/PluginStore/index.ts} +0 -0
@@ -162,6 +162,49 @@ describe('OpenAIStream', () => {
162
162
  );
163
163
  });
164
164
 
165
+ it('should handle content with tool_calls but is an empty object', async () => {
166
+ // data: {"id":"chatcmpl-A7pokGUqSov0JuMkhiHhWU9GRtAgJ", "object":"chat.completion.chunk", "created":1726430846, "model":"gpt-4o-2024-05-13", "choices":[{"index":0, "delta":{"content":" today", "role":"", "tool_calls":[]}, "finish_reason":"", "logprobs":""}], "prompt_annotations":[{"prompt_index":0, "content_filter_results":null}]}
167
+ const mockOpenAIStream = new ReadableStream({
168
+ start(controller) {
169
+ controller.enqueue({
170
+ choices: [
171
+ {
172
+ "index": 0,
173
+ "delta": {
174
+ "content": "Some contents",
175
+ "role": "",
176
+ "tool_calls": []
177
+ },
178
+ "finish_reason": "",
179
+ "logprobs": ""
180
+ }
181
+ ],
182
+ id: '456',
183
+ });
184
+
185
+ controller.close();
186
+ },
187
+ });
188
+
189
+ const onToolCallMock = vi.fn();
190
+
191
+ const protocolStream = OpenAIStream(mockOpenAIStream, {
192
+ onToolCall: onToolCallMock,
193
+ });
194
+
195
+ const decoder = new TextDecoder();
196
+ const chunks = [];
197
+
198
+ // @ts-ignore
199
+ for await (const chunk of protocolStream) {
200
+ chunks.push(decoder.decode(chunk, { stream: true }));
201
+ }
202
+
203
+ expect(chunks).toEqual(
204
+ ['id: 456', 'event: text', `data: "Some contents"\n`].map((i) => `${i}\n`),
205
+ );
206
+ });
207
+
165
208
  it('should handle other delta data', async () => {
166
209
  const mockOpenAIStream = new ReadableStream({
167
210
  start(controller) {
@@ -27,7 +27,7 @@ export const transformOpenAIStream = (
27
27
  return { data: chunk, id: chunk.id, type: 'data' };
28
28
  }
29
29
 
30
- if (item.delta?.tool_calls) {
30
+ if (typeof item.delta?.tool_calls === 'object' && item.delta.tool_calls?.length > 0) {
31
31
  return {
32
32
  data: item.delta.tool_calls.map((value, index): StreamToolCallChunkData => {
33
33
  if (stack && !stack.tool) {
@@ -11,7 +11,7 @@ import { normalizeLocale } from '@/locales/resources';
11
11
  import { isDev, isOnServerSide } from '@/utils/env';
12
12
 
13
13
  const { I18N_DEBUG, I18N_DEBUG_BROWSER, I18N_DEBUG_SERVER } = getDebugConfig();
14
- const debugMode = I18N_DEBUG ?? isOnServerSide ? I18N_DEBUG_SERVER : I18N_DEBUG_BROWSER;
14
+ const debugMode = (I18N_DEBUG ?? isOnServerSide) ? I18N_DEBUG_SERVER : I18N_DEBUG_BROWSER;
15
15
 
16
16
  export const createI18nNext = (lang?: string) => {
17
17
  const instance = i18n
@@ -188,8 +188,8 @@ export default {
188
188
  },
189
189
  tab: {
190
190
  chat: '会话',
191
+ discover: '发现',
191
192
  files: '文件',
192
- market: '发现',
193
193
  me: '我',
194
194
  setting: '设置',
195
195
  },
@@ -0,0 +1,205 @@
1
+ export default {
2
+ assistants: {
3
+ addAgent: '添加助手',
4
+ addAgentAndConverse: '添加助手并会话',
5
+ addAgentSuccess: '添加成功',
6
+ conversation: {
7
+ l1: '你好,我是 **{{name}}**,你可以问我任何问题,我会尽力回答你 ~',
8
+ l2: '以下是我的能力介绍: ',
9
+ l3: '让我们开始对话吧!',
10
+ },
11
+ description: '助手介绍',
12
+ detail: '详情',
13
+ list: '助手列表',
14
+ more: '更多',
15
+ plugins: '集成插件',
16
+ recentSubmits: '最近更新',
17
+ suggestions: '相关推荐',
18
+ systemRole: '助手设定',
19
+ try: '试一下',
20
+ },
21
+ back: '返回发现',
22
+ category: {
23
+ assistant: {
24
+ academic: '学术',
25
+ all: '全部',
26
+ career: '职业',
27
+ copywriting: '文案',
28
+ design: '设计',
29
+ education: '教育',
30
+ emotions: '情感',
31
+ entertainment: '娱乐',
32
+ games: '游戏',
33
+ general: '通用',
34
+ life: '生活',
35
+ marketing: '商业',
36
+ office: '办公',
37
+ programming: '编程',
38
+ translation: '翻译',
39
+ },
40
+ plugin: {
41
+ 'all': '全部',
42
+ 'gaming-entertainment': '游戏娱乐',
43
+ 'life-style': '生活方式',
44
+ 'media-generate': '媒体生成',
45
+ 'science-education': '科学教育',
46
+ 'social': '社交媒体',
47
+ 'stocks-finance': '股票金融',
48
+ 'tools': '实用工具',
49
+ 'web-search': '网络搜索',
50
+ },
51
+ },
52
+ cleanFilter: '清除筛选',
53
+ create: '创作',
54
+ createGuide: {
55
+ func1: {
56
+ desc1: '在会话窗口中通过右上角设置进入你想提交助手的设置页面;',
57
+ desc2: '点击右上角提交到助手市场按钮。',
58
+ tag: '方法一',
59
+ title: '通过 LobeChat 提交',
60
+ },
61
+ func2: {
62
+ button: '前往 Github 助手仓库',
63
+ desc: '如果您想将助手添加到索引中,请使用 agent-template.json 或 agent-template-full.json 在 plugins 目录中创建一个条目,编写简短的描述并适当标记,然后创建一个拉取请求。',
64
+ tag: '方法二',
65
+ title: '通过 Github 提交',
66
+ },
67
+ },
68
+
69
+ dislike: '不喜欢',
70
+ filter: '筛选',
71
+ filterBy: {
72
+ authorRange: {
73
+ everyone: '所有作者',
74
+ followed: '关注的作者',
75
+ title: '作者范围',
76
+ },
77
+ contentLength: '最小上下文长度',
78
+ maxToken: {
79
+ title: '设定最大长度 (Token)',
80
+ unlimited: '无限制',
81
+ },
82
+ other: {
83
+ functionCall: '支持函数调用',
84
+ title: '其他',
85
+ vision: '支持视觉识别',
86
+ withKnowledge: '附带知识库',
87
+ withTool: '附带插件',
88
+ },
89
+ pricing: '模型价格',
90
+ timePeriod: {
91
+ all: '全部时间',
92
+ day: '近 24 小时',
93
+ month: '近 30 天',
94
+ title: '时间范围',
95
+ week: '近 7 天',
96
+ year: '近一年',
97
+ },
98
+ },
99
+ home: {
100
+ featuredAssistants: '推荐助手',
101
+ featuredModels: '推荐模型',
102
+ featuredProviders: '推荐模型服务商',
103
+ featuredTools: '推荐插件',
104
+ more: '发现更多',
105
+ },
106
+ like: '喜欢',
107
+ models: {
108
+ chat: '开始会话',
109
+ contentLength: '最大上下文长度',
110
+ free: '免费',
111
+ guide: '配置指南',
112
+ list: '模型列表',
113
+ more: '更多',
114
+ parameterList: {
115
+ defaultValue: '默认值',
116
+ docs: '查看文档',
117
+ frequency_penalty: {
118
+ desc: '此设置调整模型重复使用输入中已经出现的特定词汇的频率。较高的值使得这种重复出现的可能性降低,而负值则产生相反的效果。词汇惩罚不随出现次数增加而增加。负值将鼓励词汇的重复使用。',
119
+ title: '频率惩罚度',
120
+ },
121
+ max_tokens: {
122
+ desc: '此设置定义了模型在单次回复中可以生成的最大长度。设置较高的值允许模型生成更长的回应,而较低的值则限制回应的长度,使其更简洁。根据不同的应用场景,合理调整此值可以帮助达到预期的回应长度和详细程度。',
123
+ title: '单次回复限制',
124
+ },
125
+ presence_penalty: {
126
+ desc: '此设置旨在根据词汇在输入中出现的频率来控制词汇的重复使用。它尝试较少使用那些在输入中出现较多的词汇,其使用频率与出现频率成比例。词汇惩罚随出现次数而增加。负值将鼓励重复使用词汇。',
127
+ title: '话题新鲜度',
128
+ },
129
+ range: '范围',
130
+ temperature: {
131
+ desc: '此设置影响模型回应的多样性。较低的值会导致更可预测和典型的回应,而较高的值则鼓励更多样化和不常见的回应。当值设为0时,模型对于给定的输入总是给出相同的回应。',
132
+ title: '随机性',
133
+ },
134
+ title: '模型参数',
135
+ top_p: {
136
+ desc: '此设置将模型的选择限制为可能性最高的一定比例的词汇:只选择那些累计概率达到P的顶尖词汇。较低的值使得模型的回应更加可预测,而默认设置则允许模型从全部范围的词汇中进行选择。',
137
+ title: '核采样',
138
+ },
139
+ type: '类型',
140
+ },
141
+ providerInfo: {
142
+ apiTooltip: 'LobeChat 支持为此提供商使用自定义 API 密钥。',
143
+ input: '输入价格',
144
+ inputTooltip: '每百万个 Token 的成本',
145
+ latency: '延迟',
146
+ latencyTooltip: '服务商发送第一个 Token 的平均响应时间',
147
+ maxOutput: '最大输出长度',
148
+ maxOutputTooltip: '此端点可以生成的最大 Token 数',
149
+ officialTooltip: 'LobeHub 官方服务',
150
+ output: '输出价格',
151
+ outputTooltip: '每百万个 Token 的成本',
152
+ streamCancellationTooltip: '此服务商支持流取消功能。',
153
+ throughput: '吞吐量',
154
+ throughputTooltip: '流请求每秒传输的平均 Token 数',
155
+ },
156
+ suggestions: '相关模型',
157
+ supportedProviders: '支持该模型的服务商',
158
+ },
159
+ plugins: {
160
+ community: '社区插件',
161
+ install: '安装插件',
162
+ installed: '已安装',
163
+ list: '插件列表',
164
+ meta: {
165
+ description: '描述',
166
+ parameter: '参数',
167
+ title: '工具参数',
168
+ type: '类型',
169
+ },
170
+ more: '更多',
171
+ official: '官方插件',
172
+ recentSubmits: '最近更新',
173
+ suggestions: '相关推荐',
174
+ },
175
+ providers: {
176
+ config: '配置服务商',
177
+ list: '模型服务商列表',
178
+ modelCount: '{{count}} 个模型',
179
+ modelSite: '模型文档',
180
+ more: '更多',
181
+ officialSite: '官方网站',
182
+ showAllModels: '显示所有模型',
183
+ suggestions: '相关服务商',
184
+ supportedModels: '支持模型',
185
+ },
186
+ search: {
187
+ placeholder: '搜索名称介绍或关键词...',
188
+ result: '{{count}} 个关于 <highlight>{{keyword}}</highlight> 的搜索结果',
189
+ searching: '搜索中...',
190
+ },
191
+ sort: {
192
+ mostLiked: '最多喜欢',
193
+ mostUsed: '最多使用',
194
+ newest: '从新到旧',
195
+ oldest: '从旧到新',
196
+ recommended: '推荐',
197
+ },
198
+ tab: {
199
+ assistants: '助手',
200
+ home: '首页',
201
+ models: '模型',
202
+ plugins: '插件',
203
+ providers: '模型服务商',
204
+ },
205
+ };
@@ -4,15 +4,17 @@ import chat from './chat';
4
4
  import clerk from './clerk';
5
5
  import common from './common';
6
6
  import components from './components';
7
+ import discover from './discover';
7
8
  import error from './error';
8
9
  import file from './file';
9
10
  import knowledgeBase from './knowledgeBase';
10
- import market from './market';
11
11
  import metadata from './metadata';
12
12
  import migration from './migration';
13
13
  import modelProvider from './modelProvider';
14
+ import models from './models';
14
15
  import plugin from './plugin';
15
16
  import portal from './portal';
17
+ import providers from './providers';
16
18
  import ragEval from './ragEval';
17
19
  import setting from './setting';
18
20
  import welcome from './welcome';
@@ -23,15 +25,17 @@ const resources = {
23
25
  clerk,
24
26
  common,
25
27
  components,
28
+ discover,
26
29
  error,
27
30
  file,
28
31
  knowledgeBase,
29
- market,
30
32
  metadata,
31
33
  migration,
32
34
  modelProvider,
35
+ models,
33
36
  plugin,
34
37
  portal,
38
+ providers,
35
39
  ragEval,
36
40
  setting,
37
41
  tool,
@@ -3,10 +3,30 @@ export default {
3
3
  description: '{{appName}} 带给你最好的 ChatGPT, Claude , Gemini, OLLaMA WebUI 使用体验',
4
4
  title: '{{appName}}:个人 AI 效能工具,给自己一个更聪明的大脑',
5
5
  },
6
- market: {
6
+ discover: {
7
+ assistants: {
8
+ description:
9
+ '内容创作、文案、问答、图像生成、视频生成、语音生成、智能 Agent、自动化工作流,定制你专属的 AI / GPTs / OLLaMA 智能助手',
10
+ title: 'AI助手',
11
+ },
7
12
  description:
8
- '内容创作、文案、问答、图像生成、视频生成、语音生成、智能 Agent、自动化工作流,定制你专属的 AI 智能助手',
9
- title: '助手市场',
13
+ '内容创作、文案、问答、图像生成、视频生成、语音生成、智能 Agent、自动化工作流、自定义AI应用,定制你专属的 AI 应用工作台',
14
+ models: {
15
+ description: '探索主流 AI 模型 OpenAI / GPT / Claude 3 / Gemini / Ollama / Azure / DeepSeek',
16
+ title: 'AI模型',
17
+ },
18
+ plugins: {
19
+ description:
20
+ '搜素图表生成、学术、图像生成、视频生成、语音生成、自动化工作流,为你的助手集成丰富的插件能力',
21
+ title: 'AI插件',
22
+ },
23
+ providers: {
24
+ description:
25
+ '探索主流模型供应商 OpenAI / Qwen / Ollama / Anthropic / DeepSeek / Google Gemini / OpenRouter',
26
+ title: 'AI模型服务商',
27
+ },
28
+ search: '搜索',
29
+ title: '发现',
10
30
  },
11
31
  plugins: {
12
32
  description:
@@ -0,0 +1,15 @@
1
+ import { LOBE_DEFAULT_MODEL_LIST } from '@/config/modelProviders';
2
+
3
+ const locales: {
4
+ [key: string]: {
5
+ description?: string;
6
+ };
7
+ } = {};
8
+
9
+ LOBE_DEFAULT_MODEL_LIST.flat().forEach((model) => {
10
+ locales[model.id] = {
11
+ description: model.description,
12
+ };
13
+ });
14
+
15
+ export default locales;
@@ -0,0 +1,15 @@
1
+ import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
2
+
3
+ const locales: {
4
+ [key: string]: {
5
+ description?: string;
6
+ };
7
+ } = {};
8
+
9
+ DEFAULT_MODEL_PROVIDER_LIST.forEach((provider) => {
10
+ locales[provider.id] = {
11
+ description: provider.description,
12
+ };
13
+ });
14
+
15
+ export default locales;
@@ -7,7 +7,7 @@ export default {
7
7
  guide: {
8
8
  agents: {
9
9
  replaceBtn: '换一批',
10
- title: '新增助理推荐:',
10
+ title: '新增助手推荐:',
11
11
  },
12
12
  defaultMessage:
13
13
  '我是您的私人智能助理 {{appName}} ,请问现在能帮您做什么?\n如果需要获得更加专业或定制的助手,可以点击 `+` 创建自定义助手',
@@ -26,6 +26,8 @@ export const normalizeLocale = (locale?: string): string => {
26
26
 
27
27
  if (locale.startsWith('ar')) return 'ar';
28
28
 
29
+ if (locale.startsWith('cn')) return 'zh-CN';
30
+
29
31
  for (const l of locales) {
30
32
  if (l.startsWith(locale)) {
31
33
  return l;
package/src/server/ld.ts CHANGED
@@ -1,7 +1,17 @@
1
+ import qs from 'query-string';
1
2
  import urlJoin from 'url-join';
2
3
 
3
4
  import { BRANDING_NAME } from '@/const/branding';
4
- import { EMAIL_BUSINESS, EMAIL_SUPPORT, OFFICIAL_SITE, OFFICIAL_URL, X } from '@/const/url';
5
+ import { DEFAULT_LANG } from '@/const/locale';
6
+ import {
7
+ EMAIL_BUSINESS,
8
+ EMAIL_SUPPORT,
9
+ OFFICIAL_SITE,
10
+ OFFICIAL_URL,
11
+ X,
12
+ getCanonicalUrl,
13
+ } from '@/const/url';
14
+ import { Locales } from '@/locales/resources';
5
15
 
6
16
  import pkg from '../../package.json';
7
17
 
@@ -30,34 +40,45 @@ export const AUTHOR_LIST = {
30
40
  class Ld {
31
41
  generate({
32
42
  image = '/og/cover.png',
43
+ article,
33
44
  url,
34
45
  title,
35
46
  description,
36
47
  date,
48
+ locale = DEFAULT_LANG,
37
49
  webpage = {
38
50
  enable: true,
39
51
  },
40
52
  }: {
53
+ article?: {
54
+ author: string[];
55
+ enable?: boolean;
56
+ identifier: string;
57
+ tags?: string[];
58
+ };
41
59
  date?: string;
42
60
  description: string;
43
61
  image?: string;
62
+ locale?: Locales;
44
63
  title: string;
45
64
  url: string;
46
65
  webpage?: {
47
66
  enable?: boolean;
48
- search?: boolean;
67
+ search?: string;
49
68
  };
50
69
  }) {
51
70
  return {
52
71
  '@context': 'https://schema.org',
53
72
  '@graph': [
54
73
  this.genWebSite(),
74
+ article?.enable && this.genArticle({ ...article, date, description, locale, title, url }),
55
75
  webpage?.enable &&
56
76
  this.genWebPage({
57
77
  ...webpage,
58
78
  date,
59
79
  description,
60
80
  image,
81
+ locale,
61
82
  title,
62
83
  url,
63
84
  }),
@@ -123,17 +144,19 @@ class Ld {
123
144
  search,
124
145
  description,
125
146
  title,
147
+ locale = DEFAULT_LANG,
126
148
  url,
127
149
  }: {
128
150
  breadcrumbs?: { title: string; url: string }[];
129
151
  date?: string;
130
152
  description: string;
131
153
  image?: string;
132
- search?: boolean;
154
+ locale?: Locales;
155
+ search?: string;
133
156
  title: string;
134
157
  url: string;
135
158
  }) {
136
- const fixedUrl = this.fixUrl(url);
159
+ const fixedUrl = getCanonicalUrl(url);
137
160
  const dateCreated = date ? new Date(date).toISOString() : LAST_MODIFIED;
138
161
  const dateModified = date ? new Date(date).toISOString() : LAST_MODIFIED;
139
162
 
@@ -152,7 +175,7 @@ class Ld {
152
175
  'image': {
153
176
  '@id': this.getId(fixedUrl, '#primaryimage'),
154
177
  },
155
- 'inLanguage': 'en-US',
178
+ 'inLanguage': locale,
156
179
  'isPartOf': {
157
180
  '@id': this.getId(OFFICIAL_URL, '#website'),
158
181
  },
@@ -167,14 +190,17 @@ class Ld {
167
190
  baseInfo.potentialAction = {
168
191
  '@type': 'SearchAction',
169
192
  'query-input': 'required name=search_term_string',
170
- 'target': `${fixedUrl}?q={search_term_string}`,
193
+ 'target': qs.stringifyUrl({
194
+ query: { q: '{search_term_string}' },
195
+ url: getCanonicalUrl(search),
196
+ }),
171
197
  };
172
198
 
173
199
  return baseInfo;
174
200
  }
175
201
 
176
202
  genImageObject({ image, url }: { image: string; url: string }) {
177
- const fixedUrl = this.fixUrl(url);
203
+ const fixedUrl = getCanonicalUrl(url);
178
204
 
179
205
  return {
180
206
  '@id': this.getId(fixedUrl, '#primaryimage'),
@@ -201,6 +227,58 @@ class Ld {
201
227
  return baseInfo;
202
228
  }
203
229
 
230
+ genArticle({
231
+ description,
232
+ title,
233
+ url,
234
+ author,
235
+ date,
236
+ locale = DEFAULT_LANG,
237
+ tags,
238
+ identifier,
239
+ }: {
240
+ author: string[];
241
+ date?: string;
242
+ description: string;
243
+ identifier: string;
244
+ locale: Locales;
245
+ tags?: string[];
246
+ title: string;
247
+ url: string;
248
+ }) {
249
+ const fixedUrl = getCanonicalUrl(url);
250
+
251
+ const dateCreated = date ? new Date(date).toISOString() : LAST_MODIFIED;
252
+
253
+ const dateModified = date ? new Date(date).toISOString() : LAST_MODIFIED;
254
+ const baseInfo: any = {
255
+ '@type': 'Article',
256
+ 'author': this.getAuthors(author),
257
+ 'creator': author,
258
+ 'dateCreated': dateCreated,
259
+ 'dateModified': dateModified,
260
+ 'datePublished': dateCreated,
261
+ 'description': description,
262
+ 'headline': this.fixTitle(title),
263
+ 'identifier': identifier,
264
+ 'image': {
265
+ '@id': this.getId(fixedUrl, '#primaryimage'),
266
+ },
267
+ 'inLanguage': locale,
268
+ 'keywords': tags?.join(' ') || 'LobeHub LobeChat',
269
+ 'mainEntityOfPage': fixedUrl,
270
+ 'name': title,
271
+ 'publisher': {
272
+ '@id': this.getId(OFFICIAL_URL, '#organization'),
273
+ },
274
+ 'url': fixedUrl,
275
+ };
276
+
277
+ return {
278
+ ...baseInfo,
279
+ };
280
+ }
281
+
204
282
  private getId(url: string, id: string) {
205
283
  return [url, id].join('/');
206
284
  }
@@ -208,10 +286,6 @@ class Ld {
208
286
  private fixTitle(title: string) {
209
287
  return title.includes(BRANDING_NAME) ? title : `${title} · ${BRANDING_NAME}`;
210
288
  }
211
-
212
- private fixUrl(url: string) {
213
- return urlJoin(OFFICIAL_URL, url);
214
- }
215
289
  }
216
290
 
217
291
  export const ldModule = new Ld();