@lobehub/chat 1.17.7 → 1.18.1

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 (337) hide show
  1. package/.dockerignore +0 -1
  2. package/CHANGELOG.md +42 -0
  3. package/locales/ar/common.json +1 -1
  4. package/locales/ar/discover.json +204 -0
  5. package/locales/ar/metadata.json +20 -3
  6. package/locales/ar/models.json +845 -0
  7. package/locales/ar/providers.json +80 -0
  8. package/locales/bg-BG/common.json +1 -1
  9. package/locales/bg-BG/discover.json +204 -0
  10. package/locales/bg-BG/metadata.json +20 -3
  11. package/locales/bg-BG/models.json +845 -0
  12. package/locales/bg-BG/providers.json +80 -0
  13. package/locales/de-DE/common.json +1 -1
  14. package/locales/de-DE/discover.json +204 -0
  15. package/locales/de-DE/metadata.json +20 -3
  16. package/locales/de-DE/models.json +845 -0
  17. package/locales/de-DE/providers.json +80 -0
  18. package/locales/en-US/common.json +1 -1
  19. package/locales/en-US/discover.json +204 -0
  20. package/locales/en-US/metadata.json +20 -3
  21. package/locales/en-US/models.json +845 -0
  22. package/locales/en-US/providers.json +80 -0
  23. package/locales/es-ES/common.json +1 -1
  24. package/locales/es-ES/discover.json +204 -0
  25. package/locales/es-ES/metadata.json +20 -3
  26. package/locales/es-ES/models.json +845 -0
  27. package/locales/es-ES/providers.json +80 -0
  28. package/locales/fr-FR/common.json +1 -1
  29. package/locales/fr-FR/discover.json +204 -0
  30. package/locales/fr-FR/metadata.json +20 -3
  31. package/locales/fr-FR/models.json +845 -0
  32. package/locales/fr-FR/providers.json +80 -0
  33. package/locales/it-IT/common.json +1 -1
  34. package/locales/it-IT/discover.json +204 -0
  35. package/locales/it-IT/metadata.json +20 -3
  36. package/locales/it-IT/models.json +845 -0
  37. package/locales/it-IT/providers.json +80 -0
  38. package/locales/ja-JP/common.json +1 -1
  39. package/locales/ja-JP/discover.json +204 -0
  40. package/locales/ja-JP/metadata.json +20 -3
  41. package/locales/ja-JP/models.json +845 -0
  42. package/locales/ja-JP/providers.json +80 -0
  43. package/locales/ko-KR/common.json +1 -1
  44. package/locales/ko-KR/discover.json +204 -0
  45. package/locales/ko-KR/metadata.json +20 -3
  46. package/locales/ko-KR/models.json +845 -0
  47. package/locales/ko-KR/providers.json +80 -0
  48. package/locales/nl-NL/common.json +1 -1
  49. package/locales/nl-NL/discover.json +204 -0
  50. package/locales/nl-NL/metadata.json +20 -3
  51. package/locales/nl-NL/models.json +845 -0
  52. package/locales/nl-NL/providers.json +80 -0
  53. package/locales/pl-PL/common.json +1 -1
  54. package/locales/pl-PL/discover.json +204 -0
  55. package/locales/pl-PL/metadata.json +20 -3
  56. package/locales/pl-PL/models.json +845 -0
  57. package/locales/pl-PL/providers.json +80 -0
  58. package/locales/pt-BR/common.json +1 -1
  59. package/locales/pt-BR/discover.json +204 -0
  60. package/locales/pt-BR/metadata.json +20 -3
  61. package/locales/pt-BR/models.json +845 -0
  62. package/locales/pt-BR/providers.json +80 -0
  63. package/locales/ru-RU/common.json +1 -1
  64. package/locales/ru-RU/discover.json +204 -0
  65. package/locales/ru-RU/metadata.json +20 -3
  66. package/locales/ru-RU/models.json +845 -0
  67. package/locales/ru-RU/providers.json +80 -0
  68. package/locales/tr-TR/common.json +1 -1
  69. package/locales/tr-TR/discover.json +204 -0
  70. package/locales/tr-TR/metadata.json +20 -3
  71. package/locales/tr-TR/models.json +845 -0
  72. package/locales/tr-TR/providers.json +80 -0
  73. package/locales/vi-VN/common.json +1 -1
  74. package/locales/vi-VN/discover.json +204 -0
  75. package/locales/vi-VN/metadata.json +20 -3
  76. package/locales/vi-VN/models.json +845 -0
  77. package/locales/vi-VN/providers.json +80 -0
  78. package/locales/zh-CN/common.json +1 -1
  79. package/locales/zh-CN/discover.json +204 -0
  80. package/locales/zh-CN/metadata.json +20 -3
  81. package/locales/zh-CN/models.json +845 -0
  82. package/locales/zh-CN/providers.json +80 -0
  83. package/locales/zh-CN/welcome.json +1 -1
  84. package/locales/zh-TW/common.json +1 -1
  85. package/locales/zh-TW/discover.json +204 -0
  86. package/locales/zh-TW/metadata.json +20 -3
  87. package/locales/zh-TW/models.json +845 -0
  88. package/locales/zh-TW/providers.json +80 -0
  89. package/package.json +3 -2
  90. package/src/app/(main)/@nav/_layout/Desktop/TopActions.test.tsx +3 -3
  91. package/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +3 -3
  92. package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
  93. package/src/app/(main)/_layout/Mobile.tsx +9 -1
  94. package/src/app/(main)/discover/(detail)/_layout/Desktop.tsx +24 -0
  95. package/src/app/(main)/discover/(detail)/_layout/Mobile/Header.tsx +25 -0
  96. package/src/app/(main)/discover/(detail)/_layout/Mobile/index.tsx +17 -0
  97. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Actions.tsx +35 -0
  98. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/AddAgent.tsx +86 -0
  99. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/TopicList.tsx +74 -0
  100. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/index.tsx +100 -0
  101. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Header.tsx +118 -0
  102. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/SuggestionItem.tsx +62 -0
  103. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/ToolItem.tsx +19 -0
  104. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/index.tsx +64 -0
  105. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/SystemRole.tsx +35 -0
  106. package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Temp.tsx +44 -0
  107. package/src/app/(main)/discover/(detail)/assistant/[slug]/page.tsx +121 -0
  108. package/src/app/(main)/discover/(detail)/error.tsx +5 -0
  109. package/src/app/(main)/discover/(detail)/features/Back.tsx +42 -0
  110. package/src/app/(main)/discover/(detail)/features/Block.tsx +50 -0
  111. package/src/app/(main)/discover/(detail)/features/DetailLayout.tsx +91 -0
  112. package/src/app/(main)/discover/(detail)/features/HighlightBlock.tsx +82 -0
  113. package/src/app/(main)/discover/(detail)/features/ShareButton.tsx +160 -0
  114. package/src/app/(main)/discover/(detail)/features/SidebarContainer.tsx +19 -0
  115. package/src/app/(main)/discover/(detail)/layout.tsx +12 -0
  116. package/src/app/(main)/discover/(detail)/loading.tsx +38 -0
  117. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Actions.tsx +46 -0
  118. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ChatWithModel.tsx +93 -0
  119. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Header.tsx +85 -0
  120. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/SuggestionItem.tsx +75 -0
  121. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/index.tsx +49 -0
  122. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ParameterList/ParameterItem.tsx +71 -0
  123. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ParameterList/index.tsx +110 -0
  124. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/ProviderItem.tsx +152 -0
  125. package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/index.tsx +45 -0
  126. package/src/app/(main)/discover/(detail)/model/[...slugs]/page.tsx +114 -0
  127. package/src/app/(main)/discover/(detail)/not-found.tsx +3 -0
  128. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Actions.tsx +35 -0
  129. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Header.tsx +114 -0
  130. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/SuggestionItem.tsx +62 -0
  131. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/index.tsx +49 -0
  132. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InstallPlugin.tsx +87 -0
  133. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/ParameterList.tsx +95 -0
  134. package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Schema.tsx +23 -0
  135. package/src/app/(main)/discover/(detail)/plugin/[slug]/page.tsx +103 -0
  136. package/src/app/(main)/discover/(detail)/provider/[slug]/features/Actions.tsx +49 -0
  137. package/src/app/(main)/discover/(detail)/provider/[slug]/features/Header.tsx +73 -0
  138. package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +75 -0
  139. package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/index.tsx +49 -0
  140. package/src/app/(main)/discover/(detail)/provider/[slug]/features/ModelList/ModelItem.tsx +148 -0
  141. package/src/app/(main)/discover/(detail)/provider/[slug]/features/ModelList/index.tsx +60 -0
  142. package/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx +80 -0
  143. package/src/app/(main)/discover/(detail)/provider/[slug]/page.tsx +116 -0
  144. package/src/app/(main)/discover/(list)/(home)/Client.tsx +42 -0
  145. package/src/app/(main)/discover/(list)/(home)/features/AssistantList.tsx +33 -0
  146. package/src/app/(main)/discover/(list)/(home)/features/ModelList.tsx +22 -0
  147. package/src/app/(main)/discover/(list)/(home)/features/PluginList.tsx +25 -0
  148. package/src/app/(main)/discover/(list)/(home)/loading.tsx +1 -0
  149. package/src/app/(main)/discover/(list)/(home)/page.tsx +54 -0
  150. package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +118 -0
  151. package/src/app/(main)/discover/(list)/_layout/Desktop/index.tsx +37 -0
  152. package/src/app/(main)/discover/(list)/_layout/Desktop/useScroll.ts +33 -0
  153. package/src/app/(main)/discover/(list)/_layout/Mobile/Header.tsx +62 -0
  154. package/src/app/(main)/discover/(list)/_layout/Mobile/Nav.tsx +94 -0
  155. package/src/app/(main)/discover/(list)/_layout/Mobile/index.tsx +27 -0
  156. package/src/app/(main)/discover/(list)/assistants/[slug]/page.tsx +64 -0
  157. package/src/app/(main)/discover/(list)/assistants/_layout/Desktop.tsx +22 -0
  158. package/src/app/(main)/discover/(list)/assistants/_layout/Mobile.tsx +9 -0
  159. package/src/app/(main)/discover/(list)/assistants/features/Card.tsx +176 -0
  160. package/src/app/(main)/discover/(list)/assistants/features/Category.tsx +48 -0
  161. package/src/app/(main)/discover/(list)/assistants/features/List.tsx +97 -0
  162. package/src/app/(main)/discover/(list)/assistants/features/useCategory.tsx +116 -0
  163. package/src/app/(main)/discover/(list)/assistants/layout.tsx +12 -0
  164. package/src/app/(main)/discover/(list)/assistants/loading.tsx +1 -0
  165. package/src/app/(main)/discover/(list)/assistants/page.tsx +51 -0
  166. package/src/app/(main)/discover/(list)/error.tsx +5 -0
  167. package/src/app/(main)/{market → discover/(list)}/layout.tsx +4 -3
  168. package/src/app/(main)/discover/(list)/loading.tsx +39 -0
  169. package/src/app/(main)/discover/(list)/models/[slug]/page.tsx +70 -0
  170. package/src/app/(main)/discover/(list)/models/_layout/Desktop.tsx +28 -0
  171. package/src/app/(main)/discover/(list)/models/_layout/Mobile.tsx +9 -0
  172. package/src/app/(main)/discover/(list)/models/features/Card.tsx +116 -0
  173. package/src/app/(main)/discover/(list)/models/features/Category.tsx +67 -0
  174. package/src/app/(main)/discover/(list)/models/features/List.tsx +72 -0
  175. package/src/app/(main)/discover/(list)/models/features/const.ts +9 -0
  176. package/src/app/(main)/discover/(list)/models/layout.tsx +12 -0
  177. package/src/app/(main)/discover/(list)/models/loading.tsx +1 -0
  178. package/src/app/(main)/discover/(list)/models/page.tsx +61 -0
  179. package/src/app/(main)/discover/(list)/not-found.tsx +3 -0
  180. package/src/app/(main)/discover/(list)/plugins/[slug]/page.tsx +64 -0
  181. package/src/app/(main)/discover/(list)/plugins/_layout/Desktop.tsx +22 -0
  182. package/src/app/(main)/discover/(list)/plugins/_layout/Mobile.tsx +9 -0
  183. package/src/app/(main)/discover/(list)/plugins/features/Card.tsx +154 -0
  184. package/src/app/(main)/discover/(list)/plugins/features/Category.tsx +45 -0
  185. package/src/app/(main)/discover/(list)/plugins/features/List.tsx +96 -0
  186. package/src/app/(main)/discover/(list)/plugins/features/useCategory.tsx +80 -0
  187. package/src/app/(main)/discover/(list)/plugins/layout.tsx +12 -0
  188. package/src/app/(main)/discover/(list)/plugins/loading.tsx +1 -0
  189. package/src/app/(main)/discover/(list)/plugins/page.tsx +52 -0
  190. package/src/app/(main)/discover/(list)/providers/features/Card.tsx +117 -0
  191. package/src/app/(main)/discover/(list)/providers/features/List.tsx +71 -0
  192. package/src/app/(main)/discover/(list)/providers/loading.tsx +1 -0
  193. package/src/app/(main)/discover/(list)/providers/page.tsx +52 -0
  194. package/src/app/(main)/discover/_layout/Desktop/Header.tsx +36 -0
  195. package/src/app/(main)/discover/_layout/Desktop/index.tsx +21 -0
  196. package/src/app/(main)/discover/_layout/Mobile/index.tsx +9 -0
  197. package/src/app/(main)/{market/features/AgentCard/AgentCardBanner.tsx → discover/components/CardBanner.tsx} +5 -5
  198. package/src/app/(main)/discover/components/CategoryContainer.tsx +18 -0
  199. package/src/app/(main)/discover/components/CategoryMenu.tsx +39 -0
  200. package/src/app/(main)/discover/components/GitHubAvatar.tsx +19 -0
  201. package/src/app/(main)/discover/components/GridLoadingCard.tsx +69 -0
  202. package/src/app/(main)/discover/components/ListLoading.tsx +66 -0
  203. package/src/app/(main)/discover/components/Loading.tsx +17 -0
  204. package/src/app/(main)/discover/components/SearchResultCount.tsx +37 -0
  205. package/src/app/(main)/discover/components/Statistic.tsx +92 -0
  206. package/src/app/(main)/discover/components/Title.tsx +76 -0
  207. package/src/app/(main)/discover/components/VirtuosoGridList/index.tsx +52 -0
  208. package/src/app/(main)/discover/components/VirtuosoGridList/useScrollParent.ts +19 -0
  209. package/src/app/(main)/discover/error.tsx +5 -0
  210. package/src/app/(main)/{market/features/ShareAgentButton → discover/features/CreateButton}/Inner.tsx +9 -10
  211. package/src/app/(main)/{market/features/ShareAgentButton → discover/features/CreateButton}/index.tsx +9 -9
  212. package/src/app/(main)/discover/features/LikeButton.tsx +73 -0
  213. package/src/app/(main)/discover/features/ModelFeatureTags.tsx +77 -0
  214. package/src/app/(main)/discover/features/StoreSearchBar.tsx +84 -0
  215. package/src/app/(main)/discover/features/const.ts +2 -0
  216. package/src/app/(main)/discover/features/useNav.tsx +71 -0
  217. package/src/app/(main)/discover/layout.tsx +12 -0
  218. package/src/app/(main)/discover/loading.tsx +9 -0
  219. package/src/app/(main)/discover/not-found.tsx +3 -0
  220. package/src/app/(main)/discover/search/_layout/Desktop.tsx +42 -0
  221. package/src/app/(main)/discover/search/_layout/Mobile/Header.tsx +31 -0
  222. package/src/app/(main)/discover/search/_layout/Mobile/Nav.tsx +56 -0
  223. package/src/app/(main)/discover/search/_layout/Mobile/index.tsx +32 -0
  224. package/src/app/(main)/discover/search/features/AssistantsResult.tsx +27 -0
  225. package/src/app/(main)/discover/search/features/Category.tsx +41 -0
  226. package/src/app/(main)/discover/search/features/ModelsResult.tsx +27 -0
  227. package/src/app/(main)/discover/search/features/PluginsResult.tsx +27 -0
  228. package/src/app/(main)/discover/search/features/ProvidersResult.tsx +26 -0
  229. package/src/app/(main)/discover/search/layout.tsx +12 -0
  230. package/src/app/(main)/discover/search/loading.tsx +1 -0
  231. package/src/app/(main)/discover/search/page.tsx +78 -0
  232. package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +0 -6
  233. package/src/app/(main)/welcome/features/Actions.tsx +1 -1
  234. package/src/app/@modal/(.)discover/assistant/[slug]/page.tsx +1 -0
  235. package/src/app/@modal/(.)discover/layout.tsx +29 -0
  236. package/src/app/@modal/(.)discover/loading.tsx +3 -0
  237. package/src/app/@modal/(.)discover/model/[...slugs]/page.tsx +1 -0
  238. package/src/app/@modal/(.)discover/plugin/[slug]/page.tsx +1 -0
  239. package/src/app/@modal/(.)discover/provider/[slug]/page.tsx +1 -0
  240. package/src/app/@modal/features/InterceptingContext.tsx +9 -0
  241. package/src/app/@modal/layout.tsx +58 -21
  242. package/src/app/api/{market → assistant}/[id]/route.ts +2 -3
  243. package/src/app/api/{market → assistant/store}/route.ts +2 -5
  244. package/src/app/api/plugin/store/route.ts +1 -4
  245. package/src/app/metadata.ts +3 -0
  246. package/src/app/redirect/page.tsx +15 -0
  247. package/src/components/FetchErrorNotification/Description.tsx +2 -0
  248. package/src/components/InterceptingLink/index.tsx +27 -0
  249. package/src/components/mdx/CodeBlock.tsx +46 -0
  250. package/src/components/mdx/Link.tsx +21 -0
  251. package/src/components/mdx/index.tsx +51 -0
  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/locales/create.ts +1 -1
  265. package/src/locales/default/common.ts +1 -1
  266. package/src/locales/default/discover.ts +205 -0
  267. package/src/locales/default/index.ts +6 -2
  268. package/src/locales/default/metadata.ts +23 -3
  269. package/src/locales/default/models.ts +15 -0
  270. package/src/locales/default/providers.ts +15 -0
  271. package/src/locales/default/welcome.ts +1 -1
  272. package/src/locales/resources.ts +2 -0
  273. package/src/server/ld.ts +85 -11
  274. package/src/server/metadata.ts +41 -3
  275. package/src/{app/api/market/AgentMarket.test.ts → server/modules/AssistantStore/index.test.ts} +15 -15
  276. package/src/{app/api/market/AgentMarket.ts → server/modules/AssistantStore/index.ts} +7 -3
  277. package/src/{app/api/plugin/store/Store.test.ts → server/modules/PluginStore/index.test.ts} +1 -1
  278. package/src/server/services/discover/index.ts +352 -0
  279. package/src/server/services/doc/index.tsx +40 -0
  280. package/src/server/translation.ts +11 -5
  281. package/src/services/__tests__/__snapshots__/tool.test.ts.snap +1 -1
  282. package/src/services/{_auth.test.ts → __tests__/_auth.test.ts} +1 -1
  283. package/src/services/__tests__/assistant.test.ts +82 -0
  284. package/src/services/__tests__/tool.test.ts +13 -13
  285. package/src/services/_url.ts +2 -2
  286. package/src/services/assistant.ts +30 -0
  287. package/src/services/chat.ts +1 -1
  288. package/src/services/tool.ts +7 -129
  289. package/src/store/chat/slices/plugin/action.test.ts +112 -0
  290. package/src/store/chat/slices/plugin/action.ts +1 -3
  291. package/src/store/global/initialState.ts +1 -1
  292. package/src/store/tool/selectors/tool.test.ts +1 -1
  293. package/src/store/tool/slices/customPlugin/action.test.ts +1 -1
  294. package/src/store/tool/slices/customPlugin/action.ts +1 -1
  295. package/src/store/tool/slices/plugin/action.ts +1 -1
  296. package/src/store/tool/slices/plugin/selectors.test.ts +3 -3
  297. package/src/store/tool/slices/plugin/selectors.ts +3 -3
  298. package/src/store/tool/slices/store/action.test.ts +16 -22
  299. package/src/store/tool/slices/store/action.ts +8 -8
  300. package/src/types/discover.ts +152 -0
  301. package/src/types/llm.ts +4 -2
  302. package/src/types/meta.ts +1 -0
  303. package/src/utils/format.test.ts +191 -112
  304. package/src/utils/format.ts +36 -0
  305. package/src/utils/toolManifest.ts +124 -0
  306. package/src/app/(main)/market/@detail/default.tsx +0 -12
  307. package/src/app/(main)/market/@detail/features/AgentDetailContent.tsx +0 -73
  308. package/src/app/(main)/market/@detail/features/Banner.tsx +0 -46
  309. package/src/app/(main)/market/@detail/features/Comment.tsx +0 -16
  310. package/src/app/(main)/market/@detail/features/Header.tsx +0 -81
  311. package/src/app/(main)/market/@detail/features/Loading.tsx +0 -63
  312. package/src/app/(main)/market/@detail/features/TokenTag.tsx +0 -27
  313. package/src/app/(main)/market/@detail/features/style.ts +0 -32
  314. package/src/app/(main)/market/_layout/Desktop/DetailSidebar.tsx +0 -84
  315. package/src/app/(main)/market/_layout/Desktop/Header.tsx +0 -29
  316. package/src/app/(main)/market/_layout/Desktop/Hero.tsx +0 -40
  317. package/src/app/(main)/market/_layout/Desktop/index.tsx +0 -46
  318. package/src/app/(main)/market/_layout/Mobile/DetailModal.tsx +0 -32
  319. package/src/app/(main)/market/_layout/Mobile/Header.tsx +0 -20
  320. package/src/app/(main)/market/_layout/Mobile/index.tsx +0 -25
  321. package/src/app/(main)/market/_layout/type.ts +0 -6
  322. package/src/app/(main)/market/features/AgentCard/index.tsx +0 -139
  323. package/src/app/(main)/market/features/AgentList.tsx +0 -103
  324. package/src/app/(main)/market/features/AgentSearchBar.tsx +0 -42
  325. package/src/app/(main)/market/features/TagList.tsx +0 -69
  326. package/src/app/(main)/market/loading.tsx +0 -15
  327. package/src/app/(main)/market/page.tsx +0 -44
  328. package/src/const/market.ts +0 -15
  329. package/src/locales/default/market.ts +0 -32
  330. package/src/services/market.ts +0 -22
  331. package/src/store/market/action.ts +0 -82
  332. package/src/store/market/index.ts +0 -3
  333. package/src/store/market/initialState.ts +0 -19
  334. package/src/store/market/selectors.ts +0 -38
  335. package/src/store/market/store.ts +0 -48
  336. package/src/types/market.ts +0 -20
  337. /package/src/{app/api/plugin/store/Store.ts → server/modules/PluginStore/index.ts} +0 -0
@@ -0,0 +1,62 @@
1
+ import { Avatar } from '@lobehub/ui';
2
+ import { Typography } from 'antd';
3
+ import { createStyles } from 'antd-style';
4
+ import { memo } from 'react';
5
+ import { Flexbox, FlexboxProps } from 'react-layout-kit';
6
+
7
+ import { DiscoverAssistantItem } from '@/types/discover';
8
+
9
+ const { Paragraph, Title } = Typography;
10
+
11
+ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
12
+ banner: css`
13
+ opacity: ${isDarkMode ? 0.9 : 0.4};
14
+ `,
15
+ container: css`
16
+ cursor: pointer;
17
+ position: relative;
18
+ overflow: hidden;
19
+ height: 100%;
20
+ `,
21
+ desc: css`
22
+ margin-block-end: 0 !important;
23
+ color: ${token.colorTextDescription};
24
+ `,
25
+ title: css`
26
+ margin-block-end: 0 !important;
27
+ font-size: 16px !important;
28
+ font-weight: 500 !important;
29
+ `,
30
+ }));
31
+
32
+ export interface SuggestionItemProps
33
+ extends Omit<DiscoverAssistantItem, 'suggestions' | 'socialData' | 'category' | 'config'>,
34
+ FlexboxProps {}
35
+
36
+ const SuggestionItem = memo<SuggestionItemProps>(({ className, meta, identifier, ...rest }) => {
37
+ const { avatar, title, description, backgroundColor } = meta;
38
+
39
+ const { cx, styles, theme } = useStyles();
40
+
41
+ return (
42
+ <Flexbox className={cx(styles.container, className)} gap={12} key={identifier} {...rest}>
43
+ <Flexbox align={'center'} gap={12} horizontal width={'100%'}>
44
+ <Avatar
45
+ alt={title}
46
+ avatar={avatar}
47
+ background={backgroundColor || theme.colorFillTertiary}
48
+ size={36}
49
+ title={title}
50
+ />
51
+ <Title className={styles.title} ellipsis={{ rows: 1, tooltip: title }} level={3}>
52
+ {title}
53
+ </Title>
54
+ </Flexbox>
55
+ <Paragraph className={styles.desc} ellipsis={{ rows: 2 }}>
56
+ {description}
57
+ </Paragraph>
58
+ </Flexbox>
59
+ );
60
+ });
61
+
62
+ export default SuggestionItem;
@@ -0,0 +1,19 @@
1
+ import { Avatar } from '@lobehub/ui';
2
+ import { useTheme } from 'antd-style';
3
+ import { memo } from 'react';
4
+ import { Flexbox } from 'react-layout-kit';
5
+
6
+ import { DiscoverPlugintem } from '@/types/discover';
7
+
8
+ const ToolItem = memo<DiscoverPlugintem>(({ meta }) => {
9
+ const theme = useTheme();
10
+
11
+ return (
12
+ <Flexbox align={'center'} gap={12} horizontal>
13
+ <Avatar avatar={meta?.avatar || '🧩'} background={theme.colorFillTertiary} size={36} />
14
+ <span style={{ fontSize: 16, fontWeight: 500 }}>{meta?.title}</span>
15
+ </Flexbox>
16
+ );
17
+ });
18
+
19
+ export default ToolItem;
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+
3
+ import { Skeleton } from 'antd';
4
+ import { memo } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { Flexbox, FlexboxProps } from 'react-layout-kit';
7
+ import urlJoin from 'url-join';
8
+
9
+ import InterceptingLink from '@/components/InterceptingLink';
10
+ import { DiscoverAssistantItem, DiscoverPlugintem } from '@/types/discover';
11
+
12
+ import Block from '../../../../features/Block';
13
+ import SuggestionItem from './SuggestionItem';
14
+ import ToolItem from './ToolItem';
15
+
16
+ interface InfoSidebarProps extends FlexboxProps {
17
+ data: DiscoverAssistantItem;
18
+ identifier: string;
19
+ mobile?: boolean;
20
+ pluginData?: DiscoverPlugintem[];
21
+ }
22
+
23
+ const InfoSidebar = memo<InfoSidebarProps>(({ pluginData, data, ...rest }) => {
24
+ const { t } = useTranslation('discover');
25
+
26
+ return (
27
+ <Flexbox gap={48} style={{ position: 'relative' }} width={'100%'} {...rest}>
28
+ {pluginData && pluginData?.length > 0 && (
29
+ <Block gap={12} title={t('assistants.plugins')}>
30
+ {pluginData.map((item) => (
31
+ <InterceptingLink
32
+ href={urlJoin('/discover/plugin', item.identifier)}
33
+ key={item.identifier}
34
+ style={{ color: 'inherit' }}
35
+ >
36
+ <ToolItem {...item} />
37
+ </InterceptingLink>
38
+ ))}
39
+ </Block>
40
+ )}
41
+ <Block
42
+ gap={24}
43
+ more={t('assistants.more')}
44
+ moreLink={urlJoin('/discover/assistants', data.meta?.category || '')}
45
+ title={t('assistants.suggestions')}
46
+ >
47
+ {data?.suggestions?.length > 0 ? (
48
+ data?.suggestions.map((item) => (
49
+ <InterceptingLink
50
+ href={urlJoin('/discover/assistant', item.identifier)}
51
+ key={item.identifier}
52
+ >
53
+ <SuggestionItem {...item} />
54
+ </InterceptingLink>
55
+ ))
56
+ ) : (
57
+ <Skeleton active paragraph={{ rows: 5 }} title={false} />
58
+ )}
59
+ </Block>
60
+ </Flexbox>
61
+ );
62
+ });
63
+
64
+ export default InfoSidebar;
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+
3
+ import { Markdown } from '@lobehub/ui';
4
+ import { Skeleton } from 'antd';
5
+ import { useTheme } from 'antd-style';
6
+ import { memo } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
+
9
+ import Block from '../../../features/Block';
10
+
11
+ const SystemRole = memo<{ children?: string }>(({ children }) => {
12
+ const { t } = useTranslation('discover');
13
+ const theme = useTheme();
14
+
15
+ return (
16
+ <Block title={t('assistants.systemRole')}>
17
+ {children ? (
18
+ <Markdown
19
+ fontSize={theme.fontSize}
20
+ style={{
21
+ border: `1px solid ${theme.colorBorderSecondary}`,
22
+ borderRadius: theme.borderRadiusLG,
23
+ paddingInline: 16,
24
+ }}
25
+ >
26
+ {children}
27
+ </Markdown>
28
+ ) : (
29
+ <Skeleton paragraph={{ rows: 4 }} title={false} />
30
+ )}
31
+ </Block>
32
+ );
33
+ });
34
+
35
+ export default SystemRole;
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+
3
+ import { Markdown } from '@lobehub/ui';
4
+ import { Skeleton } from 'antd';
5
+ import { useTheme } from 'antd-style';
6
+ import { BotMessageSquare } from 'lucide-react';
7
+ import { memo } from 'react';
8
+ import { useTranslation } from 'react-i18next';
9
+ import { Flexbox, FlexboxProps } from 'react-layout-kit';
10
+
11
+ import { DiscoverAssistantItem } from '@/types/discover';
12
+
13
+ import HighlightBlock from '../../../features/HighlightBlock';
14
+
15
+ interface ConversationExampleProps extends FlexboxProps {
16
+ data: DiscoverAssistantItem;
17
+ identifier: string;
18
+ mobile?: boolean;
19
+ }
20
+
21
+ const ConversationExample = memo<ConversationExampleProps>(({ data }) => {
22
+ const { t } = useTranslation('discover');
23
+ const theme = useTheme();
24
+
25
+ return (
26
+ <HighlightBlock
27
+ avatar={data?.meta.avatar}
28
+ icon={BotMessageSquare}
29
+ justify={'space-between'}
30
+ style={{ background: theme.colorBgContainer }}
31
+ title={t('assistants.systemRole')}
32
+ >
33
+ <Flexbox paddingInline={16}>
34
+ {data.config.systemRole ? (
35
+ <Markdown fontSize={theme.fontSize}>{data.config.systemRole}</Markdown>
36
+ ) : (
37
+ <Skeleton paragraph={{ rows: 4 }} title={false} />
38
+ )}
39
+ </Flexbox>
40
+ </HighlightBlock>
41
+ );
42
+ });
43
+
44
+ export default ConversationExample;
@@ -0,0 +1,121 @@
1
+ import { notFound } from 'next/navigation';
2
+ import urlJoin from 'url-join';
3
+
4
+ import StructuredData from '@/components/StructuredData';
5
+ import { Locales } from '@/locales/resources';
6
+ import { ldModule } from '@/server/ld';
7
+ import { metadataModule } from '@/server/metadata';
8
+ import { DiscoverService } from '@/server/services/discover';
9
+ import { translation } from '@/server/translation';
10
+ import { DiscoverPlugintem } from '@/types/discover';
11
+ import { isMobileDevice } from '@/utils/responsive';
12
+
13
+ import DetailLayout from '../../features/DetailLayout';
14
+ import Actions from './features/Actions';
15
+ import Header from './features/Header';
16
+ import InfoSidebar from './features/InfoSidebar';
17
+ import Temp from './features/Temp';
18
+
19
+ // import ConversationExample from './features/ConversationExample';
20
+ // import SystemRole from './features/SystemRole';
21
+
22
+ type Props = { params: { slug: string }; searchParams: { hl?: Locales } };
23
+
24
+ export const generateMetadata = async ({ params, searchParams }: Props) => {
25
+ const { slug: identifier } = params;
26
+ const { t, locale } = await translation('metadata', searchParams?.hl);
27
+
28
+ const discoverService = new DiscoverService();
29
+ const data = await discoverService.getAssistantById(locale, identifier);
30
+ if (!data) return notFound();
31
+
32
+ const { meta, createdAt, homepage, author } = data;
33
+
34
+ return {
35
+ authors: [
36
+ { name: author, url: homepage },
37
+ { name: 'LobeHub', url: 'https://github.com/lobehub' },
38
+ { name: 'LobeChat', url: 'https://github.com/lobehub/lobe-chat' },
39
+ ],
40
+ keywords: meta.tags,
41
+ ...metadataModule.generate({
42
+ alternate: true,
43
+ description: meta.description,
44
+ locale,
45
+ tags: meta.tags,
46
+ title: [meta.title, t('discover.assistants.title')].join(' · '),
47
+ url: urlJoin('/discover/assistant', identifier),
48
+ }),
49
+ other: {
50
+ 'article:author': author,
51
+ 'article:published_time': createdAt
52
+ ? new Date(createdAt).toISOString()
53
+ : new Date().toISOString(),
54
+ 'robots': 'index,follow,max-image-preview:large',
55
+ },
56
+ };
57
+ };
58
+
59
+ const Page = async ({ params, searchParams }: Props) => {
60
+ const { slug: identifier } = params;
61
+ const { t, locale } = await translation('metadata', searchParams?.hl);
62
+ const mobile = isMobileDevice();
63
+
64
+ const discoverService = new DiscoverService();
65
+ const data = await discoverService.getAssistantById(locale, identifier);
66
+ if (!data) return notFound();
67
+
68
+ const { meta, createdAt, author, config } = data;
69
+
70
+ let pluginData: DiscoverPlugintem[] = [];
71
+ if (config?.plugins && config.plugins?.length > 0) {
72
+ pluginData = await discoverService.getPluginByIds(locale, config.plugins);
73
+ }
74
+
75
+ const ld = ldModule.generate({
76
+ article: {
77
+ author: [author],
78
+ enable: true,
79
+ identifier,
80
+ tags: meta.tags,
81
+ },
82
+ date: createdAt ? new Date(createdAt).toISOString() : new Date().toISOString(),
83
+ description: meta.description || t('discover.assistants.description'),
84
+ title: [meta.title, t('discover.assistants.title')].join(' · '),
85
+ url: urlJoin('/discover/assistant', identifier),
86
+ webpage: {
87
+ enable: true,
88
+ search: '/discover/search',
89
+ },
90
+ });
91
+
92
+ return (
93
+ <>
94
+ <StructuredData ld={ld} />
95
+ <DetailLayout
96
+ actions={<Actions data={data} identifier={identifier} />}
97
+ header={<Header data={data} identifier={identifier} mobile={mobile} />}
98
+ mobile={mobile}
99
+ sidebar={
100
+ <InfoSidebar
101
+ data={data}
102
+ identifier={identifier}
103
+ mobile={mobile}
104
+ pluginData={pluginData}
105
+ />
106
+ }
107
+ /* ↓ cloud slot ↓ */
108
+ /* ↑ cloud slot ↑ */
109
+ >
110
+ <Temp data={data} identifier={identifier} />
111
+ {/* TODO: Chat Preview */}
112
+ {/*<ConversationExample data={data} identifier={identifier} />*/}
113
+ {/*<SystemRole>{data?.config?.systemRole}</SystemRole>*/}
114
+ </DetailLayout>
115
+ </>
116
+ );
117
+ };
118
+
119
+ Page.DisplayName = 'DiscoverAssistantsDetail';
120
+
121
+ export default Page;
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+
3
+ import dynamic from 'next/dynamic';
4
+
5
+ export default dynamic(() => import('@/components/Error'));
@@ -0,0 +1,42 @@
1
+ 'use client';
2
+
3
+ import { Icon } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { ArrowLeft } from 'lucide-react';
6
+ import Link from 'next/link';
7
+ import { CSSProperties, memo } from 'react';
8
+ import { useTranslation } from 'react-i18next';
9
+ import { Flexbox } from 'react-layout-kit';
10
+
11
+ import { useInterceptingRoutes } from '@/hooks/useInterceptingRoutes';
12
+
13
+ const useStyles = createStyles(({ css, token }) => {
14
+ return {
15
+ back: css`
16
+ color: ${token.colorTextDescription};
17
+
18
+ &:hover {
19
+ color: ${token.colorText};
20
+ }
21
+ `,
22
+ };
23
+ });
24
+
25
+ const Back = memo<{ href: string; style?: CSSProperties }>(({ href, style }) => {
26
+ const { isIntercepted } = useInterceptingRoutes();
27
+ const { t } = useTranslation('discover');
28
+ const { styles } = useStyles();
29
+
30
+ if (isIntercepted) return null;
31
+
32
+ return (
33
+ <Link className={styles.back} href={href} style={{ marginBottom: 8, ...style }}>
34
+ <Flexbox align={'center'} gap={8} horizontal>
35
+ <Icon icon={ArrowLeft} />
36
+ {t(`back`)}
37
+ </Flexbox>
38
+ </Link>
39
+ );
40
+ });
41
+
42
+ export default Back;
@@ -0,0 +1,50 @@
1
+ import { Icon } from '@lobehub/ui';
2
+ import { Button } from 'antd';
3
+ import { createStyles } from 'antd-style';
4
+ import { ChevronRight } from 'lucide-react';
5
+ import Link from 'next/link';
6
+ import { memo } from 'react';
7
+ import { Flexbox, FlexboxProps } from 'react-layout-kit';
8
+
9
+ const useStyles = createStyles(({ css, token }) => ({
10
+ more: css`
11
+ display: flex;
12
+ align-items: center;
13
+ color: ${token.colorTextSecondary};
14
+ `,
15
+ title: css`
16
+ margin-block: 0;
17
+ font-size: 16px;
18
+ font-weight: bold;
19
+ line-height: 1.2;
20
+ `,
21
+ }));
22
+
23
+ interface BlockProps extends FlexboxProps {
24
+ more?: string;
25
+ moreLink?: string;
26
+ title: string;
27
+ }
28
+
29
+ const Block = memo<BlockProps>(({ title, more, moreLink, children, ...rest }) => {
30
+ const { styles } = useStyles();
31
+
32
+ return (
33
+ <Flexbox gap={16} style={{ position: 'relative' }} width={'100%'}>
34
+ <Flexbox align={'center'} gap={16} horizontal justify={'space-between'} width={'100%'}>
35
+ <h2 className={styles.title}>{title}</h2>
36
+ {moreLink && (
37
+ <Link href={moreLink} target={moreLink.startsWith('http') ? '_blank' : undefined}>
38
+ <Button className={styles.more} type={'text'}>
39
+ <span>{more}</span>
40
+ <Icon icon={ChevronRight} />
41
+ </Button>
42
+ </Link>
43
+ )}
44
+ </Flexbox>
45
+ <Flexbox {...rest}>{children}</Flexbox>
46
+ </Flexbox>
47
+ );
48
+ });
49
+
50
+ export default Block;
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+
3
+ import { useResponsive } from 'antd-style';
4
+ import { ReactNode, memo } from 'react';
5
+ import { Flexbox } from 'react-layout-kit';
6
+
7
+ import Footer from '@/features/Setting/Footer';
8
+ import { useInterceptingRoutes } from '@/hooks/useInterceptingRoutes';
9
+
10
+ import SidebarContainer from './SidebarContainer';
11
+
12
+ interface DetailLayoutProps {
13
+ actions?: ReactNode;
14
+ children?: ReactNode;
15
+ header: ReactNode;
16
+ mobile?: boolean;
17
+ sidebar?: ReactNode;
18
+ statistics?: ReactNode;
19
+ }
20
+
21
+ const DetailLayout = memo<DetailLayoutProps>(
22
+ ({ statistics, mobile, header, sidebar, children, actions }) => {
23
+ const { md = true, xl = true } = useResponsive();
24
+ const { isIntercepted } = useInterceptingRoutes();
25
+
26
+ if (mobile || !md || (isIntercepted && !xl))
27
+ return (
28
+ <>
29
+ {header}
30
+ <Flexbox gap={16} width={'100%'}>
31
+ {actions}
32
+ {statistics}
33
+ </Flexbox>
34
+ {children}
35
+ {sidebar}
36
+ <Footer />
37
+ </>
38
+ );
39
+
40
+ if (isIntercepted) {
41
+ return (
42
+ <>
43
+ <Flexbox flex={1} gap={24} style={{ overflow: 'hidden', position: 'relative' }}>
44
+ <Flexbox style={{ paddingRight: 16 }}>{header}</Flexbox>
45
+ <Flexbox
46
+ gap={24}
47
+ style={{
48
+ overflowX: 'hidden',
49
+ overflowY: 'auto',
50
+ paddingBottom: 48,
51
+ paddingRight: 16,
52
+ position: 'relative',
53
+ }}
54
+ >
55
+ {children}
56
+ <Footer />
57
+ </Flexbox>
58
+ </Flexbox>
59
+ <SidebarContainer style={{ position: 'sticky', top: '0' }}>
60
+ <Flexbox gap={16} width={'100%'}>
61
+ {actions}
62
+ {statistics}
63
+ </Flexbox>
64
+ {sidebar}
65
+ </SidebarContainer>
66
+ </>
67
+ );
68
+ }
69
+
70
+ return (
71
+ <>
72
+ {header}
73
+ <Flexbox gap={32} horizontal width={'100%'}>
74
+ <Flexbox flex={1} gap={48} style={{ overflow: 'hidden', position: 'relative' }}>
75
+ {children}
76
+ <Footer />
77
+ </Flexbox>
78
+ <SidebarContainer>
79
+ <Flexbox gap={16} width={'100%'}>
80
+ {actions}
81
+ {statistics}
82
+ </Flexbox>
83
+ {sidebar}
84
+ </SidebarContainer>
85
+ </Flexbox>
86
+ </>
87
+ );
88
+ },
89
+ );
90
+
91
+ export default DetailLayout;
@@ -0,0 +1,82 @@
1
+ 'use client';
2
+
3
+ import { Icon } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { LucideIcon } from 'lucide-react';
6
+ import { rgba } from 'polished';
7
+ import { ReactNode, memo } from 'react';
8
+ import { Flexbox, FlexboxProps } from 'react-layout-kit';
9
+
10
+ import { useServerConfigStore } from '@/store/serverConfig';
11
+
12
+ import CardBanner from '../../components/CardBanner';
13
+
14
+ const useStyles = createStyles(({ css, token }) => ({
15
+ background: css`
16
+ pointer-events: none;
17
+
18
+ position: absolute;
19
+ z-index: 0;
20
+ inset: 0;
21
+ transform: scale(3);
22
+
23
+ overflow: hidden;
24
+
25
+ &::before {
26
+ content: '';
27
+
28
+ position: absolute;
29
+ z-index: 1;
30
+ inset: 0;
31
+
32
+ width: 100%;
33
+ height: 100%;
34
+
35
+ background: ${rgba(token.colorBgContainer, 0.5)};
36
+ }
37
+ `,
38
+ container: css`
39
+ position: relative;
40
+ overflow: hidden;
41
+ border-radius: ${token.borderRadiusLG}px;
42
+ box-shadow:
43
+ 0 0 0 1px ${token.colorFill} inset,
44
+ ${token.boxShadowTertiary};
45
+ `,
46
+ header: css`
47
+ position: relative;
48
+ overflow: hidden;
49
+ height: 58px;
50
+ border-block-end: 1px solid ${token.colorBorderSecondary};
51
+ `,
52
+ }));
53
+
54
+ interface HighlightBlockProps extends FlexboxProps {
55
+ avatar?: string | ReactNode;
56
+ icon: LucideIcon;
57
+ title: string;
58
+ }
59
+
60
+ const HighlightBlock = memo<HighlightBlockProps>(({ avatar, title, icon, children, ...rest }) => {
61
+ const { styles } = useStyles();
62
+ const mobile = useServerConfigStore((s) => s.isMobile);
63
+ return (
64
+ <Flexbox className={styles.container} flex={'none'} width={'100%'} {...rest}>
65
+ <Flexbox
66
+ align={'center'}
67
+ className={styles.header}
68
+ flex={'none'}
69
+ gap={12}
70
+ horizontal
71
+ padding={16}
72
+ >
73
+ <Icon icon={icon} size={{ fontSize: 20 }} style={{ zIndex: 1 }} />
74
+ <h2 style={{ fontSize: 16, fontWeight: 'bold', margin: 0, zIndex: 1 }}>{title}</h2>
75
+ <CardBanner avatar={avatar} className={styles.background} size={mobile ? 64 : 512} />
76
+ </Flexbox>
77
+ {children}
78
+ </Flexbox>
79
+ );
80
+ });
81
+
82
+ export default HighlightBlock;