@lobehub/lobehub 2.0.0-next.337 → 2.0.0-next.339

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 (270) hide show
  1. package/.gitattributes +35 -0
  2. package/CHANGELOG.md +69 -0
  3. package/changelog/v1.json +24 -0
  4. package/locales/ar/plugin.json +12 -2
  5. package/locales/ar/providers.json +1 -0
  6. package/locales/ar/setting.json +77 -1
  7. package/locales/bg-BG/models.json +5 -10
  8. package/locales/bg-BG/plugin.json +12 -2
  9. package/locales/bg-BG/providers.json +1 -0
  10. package/locales/bg-BG/setting.json +78 -2
  11. package/locales/de-DE/models.json +51 -9
  12. package/locales/de-DE/plugin.json +12 -2
  13. package/locales/de-DE/providers.json +1 -0
  14. package/locales/de-DE/setting.json +78 -2
  15. package/locales/en-US/models.json +11 -10
  16. package/locales/en-US/plugin.json +14 -4
  17. package/locales/en-US/providers.json +1 -0
  18. package/locales/en-US/setting.json +97 -2
  19. package/locales/es-ES/plugin.json +12 -2
  20. package/locales/es-ES/providers.json +1 -0
  21. package/locales/es-ES/setting.json +78 -2
  22. package/locales/fa-IR/plugin.json +12 -2
  23. package/locales/fa-IR/providers.json +1 -0
  24. package/locales/fa-IR/setting.json +78 -2
  25. package/locales/fr-FR/plugin.json +12 -2
  26. package/locales/fr-FR/providers.json +1 -0
  27. package/locales/fr-FR/setting.json +78 -2
  28. package/locales/it-IT/plugin.json +12 -2
  29. package/locales/it-IT/providers.json +1 -0
  30. package/locales/it-IT/setting.json +78 -2
  31. package/locales/ja-JP/plugin.json +12 -2
  32. package/locales/ja-JP/providers.json +1 -0
  33. package/locales/ja-JP/setting.json +78 -2
  34. package/locales/ko-KR/plugin.json +12 -2
  35. package/locales/ko-KR/providers.json +1 -0
  36. package/locales/ko-KR/setting.json +78 -2
  37. package/locales/nl-NL/models.json +4 -9
  38. package/locales/nl-NL/plugin.json +12 -2
  39. package/locales/nl-NL/providers.json +1 -0
  40. package/locales/nl-NL/setting.json +78 -2
  41. package/locales/pl-PL/plugin.json +12 -2
  42. package/locales/pl-PL/providers.json +1 -0
  43. package/locales/pl-PL/setting.json +78 -2
  44. package/locales/pt-BR/plugin.json +12 -2
  45. package/locales/pt-BR/providers.json +1 -0
  46. package/locales/pt-BR/setting.json +78 -2
  47. package/locales/ru-RU/plugin.json +12 -2
  48. package/locales/ru-RU/providers.json +1 -0
  49. package/locales/ru-RU/setting.json +78 -2
  50. package/locales/tr-TR/plugin.json +12 -2
  51. package/locales/tr-TR/providers.json +1 -0
  52. package/locales/tr-TR/setting.json +78 -2
  53. package/locales/vi-VN/plugin.json +12 -2
  54. package/locales/vi-VN/providers.json +1 -0
  55. package/locales/vi-VN/setting.json +77 -1
  56. package/locales/zh-CN/auth.json +1 -0
  57. package/locales/zh-CN/plugin.json +12 -2
  58. package/locales/zh-CN/providers.json +1 -0
  59. package/locales/zh-CN/setting.json +97 -2
  60. package/locales/zh-TW/plugin.json +12 -2
  61. package/locales/zh-TW/providers.json +1 -0
  62. package/locales/zh-TW/setting.json +78 -2
  63. package/package.json +1 -1
  64. package/packages/agent-runtime/src/groupOrchestration/GroupOrchestrationSupervisor.ts +2 -0
  65. package/packages/agent-runtime/src/groupOrchestration/__tests__/GroupOrchestrationSupervisor.test.ts +3 -1
  66. package/packages/agent-runtime/src/groupOrchestration/types.ts +5 -0
  67. package/packages/const/src/index.ts +1 -0
  68. package/packages/const/src/klavis.ts +144 -0
  69. package/packages/const/src/lobehubSkill.ts +34 -0
  70. package/packages/const/src/recommendedSkill.ts +17 -0
  71. package/packages/model-runtime/src/core/contextBuilders/anthropic.test.ts +38 -0
  72. package/packages/model-runtime/src/core/contextBuilders/anthropic.ts +20 -1
  73. package/packages/model-runtime/src/core/contextBuilders/google.test.ts +42 -0
  74. package/packages/model-runtime/src/core/contextBuilders/google.ts +17 -0
  75. package/packages/model-runtime/src/providers/google/index.ts +14 -14
  76. package/packages/model-runtime/src/providers/moonshot/index.ts +1 -1
  77. package/packages/model-runtime/src/providers/openai/index.ts +3 -3
  78. package/packages/types/src/discover/index.ts +1 -1
  79. package/scripts/electronWorkflow/modifiers/dynamicToStatic.mts +273 -0
  80. package/scripts/electronWorkflow/modifiers/index.mts +10 -0
  81. package/scripts/electronWorkflow/modifiers/nextConfig.mts +1 -0
  82. package/scripts/electronWorkflow/modifiers/nextDynamicToStatic.mts +233 -0
  83. package/scripts/electronWorkflow/modifiers/removeSuspense.mts +124 -0
  84. package/scripts/electronWorkflow/modifiers/routes.mts +14 -2
  85. package/scripts/electronWorkflow/modifiers/settingsContentToStatic.mts +148 -0
  86. package/scripts/electronWorkflow/modifiers/wrapChildrenWithClientOnly.mts +73 -0
  87. package/src/app/[variants]/(main)/agent/cron/[cronId]/CronConfig.ts +16 -16
  88. package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobSaveButton.tsx +1 -1
  89. package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx +5 -2
  90. package/src/app/[variants]/(main)/community/features/Search.tsx +1 -1
  91. package/src/app/[variants]/(main)/home/features/InputArea/SkillInstallBanner.tsx +131 -0
  92. package/src/app/[variants]/(main)/home/features/InputArea/index.tsx +34 -27
  93. package/src/app/[variants]/(main)/settings/features/SettingHeader.tsx +8 -4
  94. package/src/app/[variants]/(main)/settings/features/SettingsContent.tsx +3 -0
  95. package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +6 -0
  96. package/src/{features/PluginStore/InstalledList/List/Item/Action.tsx → app/[variants]/(main)/settings/skill/features/Actions.tsx} +45 -40
  97. package/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx +353 -0
  98. package/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx +344 -0
  99. package/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx +116 -0
  100. package/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx +244 -0
  101. package/src/app/[variants]/(main)/settings/skill/index.tsx +35 -0
  102. package/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +27 -0
  103. package/src/app/[variants]/(mobile)/settings/_layout/Header.tsx +8 -17
  104. package/src/app/[variants]/(mobile)/settings/_layout/index.tsx +6 -1
  105. package/src/app/[variants]/(mobile)/settings/provider/_layout/index.tsx +22 -0
  106. package/src/components/Plugins/PluginTag.tsx +23 -35
  107. package/src/components/client/ClientOnly.tsx +6 -2
  108. package/src/features/AgentSetting/AgentPlugin/index.tsx +2 -2
  109. package/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx +8 -32
  110. package/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx +8 -30
  111. package/src/features/ChatInput/ActionBar/Tools/PopoverContent.tsx +48 -59
  112. package/src/features/ChatInput/ActionBar/Tools/index.tsx +5 -23
  113. package/src/features/ChatInput/ActionBar/Tools/useControls.tsx +158 -56
  114. package/src/features/IntegrationDetailModal/index.tsx +293 -0
  115. package/src/features/{PluginStore/McpList/Detail → MCP/MCPDetail}/index.tsx +15 -6
  116. package/src/features/MCP/MCPSettings/McpSettingsModal.tsx +58 -0
  117. package/src/features/{PluginStore/McpList/Detail/Settings → MCP/MCPSettings}/index.tsx +39 -27
  118. package/src/features/PluginDetailModal/index.tsx +2 -2
  119. package/src/features/PluginDevModal/index.tsx +16 -40
  120. package/src/features/ProfileEditor/AgentTool.tsx +2 -2
  121. package/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/index.tsx +1 -1
  122. package/src/features/{PluginStore/AddPluginButton.tsx → SkillStore/AddSkillButton.tsx} +3 -3
  123. package/src/features/SkillStore/CommunityList/Item.tsx +158 -0
  124. package/src/features/SkillStore/CommunityList/index.tsx +101 -0
  125. package/src/features/SkillStore/Content.tsx +59 -0
  126. package/src/features/{PluginStore/PluginEmpty.tsx → SkillStore/Empty.tsx} +8 -8
  127. package/src/features/SkillStore/LobeHubList/Item.tsx +118 -0
  128. package/src/features/SkillStore/LobeHubList/index.tsx +187 -0
  129. package/src/features/SkillStore/LobeHubList/useSkillConnect.ts +239 -0
  130. package/src/features/SkillStore/Search/index.tsx +43 -0
  131. package/src/features/{PluginStore → SkillStore}/index.tsx +14 -10
  132. package/src/features/SkillStore/style.ts +27 -0
  133. package/src/locales/default/plugin.ts +15 -4
  134. package/src/locales/default/setting.ts +204 -2
  135. package/src/services/chat/mecha/agentConfigResolver.test.ts +197 -0
  136. package/src/services/chat/mecha/agentConfigResolver.ts +44 -17
  137. package/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +40 -37
  138. package/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +78 -0
  139. package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +50 -16
  140. package/src/store/global/initialState.ts +1 -0
  141. package/src/store/tool/slices/lobehubSkillStore/action.test.ts +914 -0
  142. package/src/store/tool/slices/lobehubSkillStore/selectors.test.ts +548 -0
  143. package/.cursor/skills/vercel-react-best-practices/AGENTS.md +0 -2410
  144. package/.cursor/skills/vercel-react-best-practices/SKILL.md +0 -125
  145. package/.cursor/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  146. package/.cursor/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -49
  147. package/.cursor/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  148. package/.cursor/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
  149. package/.cursor/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -36
  150. package/.cursor/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
  151. package/.cursor/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  152. package/.cursor/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
  153. package/.cursor/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  154. package/.cursor/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  155. package/.cursor/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  156. package/.cursor/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  157. package/.cursor/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  158. package/.cursor/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  159. package/.cursor/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  160. package/.cursor/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  161. package/.cursor/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -57
  162. package/.cursor/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  163. package/.cursor/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  164. package/.cursor/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  165. package/.cursor/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  166. package/.cursor/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  167. package/.cursor/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  168. package/.cursor/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  169. package/.cursor/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
  170. package/.cursor/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  171. package/.cursor/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  172. package/.cursor/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  173. package/.cursor/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  174. package/.cursor/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  175. package/.cursor/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  176. package/.cursor/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  177. package/.cursor/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  178. package/.cursor/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  179. package/.cursor/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  180. package/.cursor/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  181. package/.cursor/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  182. package/.cursor/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  183. package/.cursor/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  184. package/.cursor/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  185. package/.cursor/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  186. package/.cursor/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  187. package/.cursor/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  188. package/.cursor/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  189. package/.cursor/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  190. package/.cursor/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  191. package/.cursor/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
  192. package/src/features/PluginStore/Content.tsx +0 -54
  193. package/src/features/PluginStore/InstalledList/Detail/CustomPluginEmptyState.tsx +0 -79
  194. package/src/features/PluginStore/InstalledList/Detail/index.tsx +0 -21
  195. package/src/features/PluginStore/InstalledList/List/Item/index.tsx +0 -61
  196. package/src/features/PluginStore/InstalledList/List/index.tsx +0 -72
  197. package/src/features/PluginStore/InstalledList/index.tsx +0 -90
  198. package/src/features/PluginStore/McpList/List/Action.tsx +0 -119
  199. package/src/features/PluginStore/McpList/List/Item.tsx +0 -83
  200. package/src/features/PluginStore/McpList/List/index.tsx +0 -93
  201. package/src/features/PluginStore/McpList/index.tsx +0 -58
  202. package/src/features/PluginStore/PluginList/Detail/DetailProvider.tsx +0 -19
  203. package/src/features/PluginStore/PluginList/Detail/EmptyState.tsx +0 -56
  204. package/src/features/PluginStore/PluginList/Detail/Header.tsx +0 -130
  205. package/src/features/PluginStore/PluginList/Detail/InstallDetail/Nav.tsx +0 -73
  206. package/src/features/PluginStore/PluginList/Detail/InstallDetail/Settings.tsx +0 -19
  207. package/src/features/PluginStore/PluginList/Detail/InstallDetail/Tools.tsx +0 -111
  208. package/src/features/PluginStore/PluginList/Detail/InstallDetail/index.tsx +0 -24
  209. package/src/features/PluginStore/PluginList/Detail/Loading.tsx +0 -42
  210. package/src/features/PluginStore/PluginList/Detail/TagList.tsx +0 -35
  211. package/src/features/PluginStore/PluginList/Detail/index.tsx +0 -39
  212. package/src/features/PluginStore/PluginList/Detail/useCategory.tsx +0 -76
  213. package/src/features/PluginStore/PluginList/List/Action.tsx +0 -78
  214. package/src/features/PluginStore/PluginList/List/Item.tsx +0 -92
  215. package/src/features/PluginStore/PluginList/List/index.tsx +0 -94
  216. package/src/features/PluginStore/PluginList/index.tsx +0 -46
  217. package/src/features/PluginStore/Search/index.tsx +0 -40
  218. /package/{.codex/skills → .agents}/vercel-react-best-practices/AGENTS.md +0 -0
  219. /package/{.codex/skills → .agents}/vercel-react-best-practices/SKILL.md +0 -0
  220. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -0
  221. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/advanced-use-latest.md +0 -0
  222. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/async-api-routes.md +0 -0
  223. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/async-defer-await.md +0 -0
  224. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/async-dependencies.md +0 -0
  225. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/async-parallel.md +0 -0
  226. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -0
  227. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -0
  228. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/bundle-conditional.md +0 -0
  229. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -0
  230. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -0
  231. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/bundle-preload.md +0 -0
  232. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/client-event-listeners.md +0 -0
  233. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -0
  234. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -0
  235. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/client-swr-dedup.md +0 -0
  236. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -0
  237. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-cache-function-results.md +0 -0
  238. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-cache-property-access.md +0 -0
  239. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-cache-storage.md +0 -0
  240. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-combine-iterations.md +0 -0
  241. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-early-exit.md +0 -0
  242. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -0
  243. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-index-maps.md +0 -0
  244. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-length-check-first.md +0 -0
  245. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-min-max-loop.md +0 -0
  246. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -0
  247. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -0
  248. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-activity.md +0 -0
  249. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -0
  250. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -0
  251. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -0
  252. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -0
  253. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -0
  254. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -0
  255. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -0
  256. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-dependencies.md +0 -0
  257. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-derived-state.md +0 -0
  258. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -0
  259. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -0
  260. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-memo.md +0 -0
  261. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/rerender-transitions.md +0 -0
  262. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -0
  263. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/server-cache-lru.md +0 -0
  264. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/server-cache-react.md +0 -0
  265. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -0
  266. /package/{.codex/skills → .agents}/vercel-react-best-practices/rules/server-serialization.md +0 -0
  267. /package/src/{features/PluginStore/InstalledList → app/[variants]/(main)/settings/skill/features}/EditCustomPlugin.tsx +0 -0
  268. /package/src/features/{PluginStore/McpList/Detail → MCP/MCPDetail}/Loading.tsx +0 -0
  269. /package/src/features/{PluginStore → SkillStore}/Loading.tsx +0 -0
  270. /package/src/features/{PluginStore → SkillStore}/VirtuosoLoading.tsx +0 -0
@@ -1,61 +0,0 @@
1
- import { Block, Flexbox, Text } from '@lobehub/ui';
2
- import { memo } from 'react';
3
-
4
- import PluginAvatar from '@/components/Plugins/PluginAvatar';
5
- import PluginTag from '@/components/Plugins/PluginTag';
6
- import { type DiscoverPluginItem } from '@/types/discover';
7
- import { type LobeToolType } from '@/types/tool/tool';
8
-
9
- import Actions from './Action';
10
-
11
- interface PluginItemProps extends DiscoverPluginItem {
12
- active?: boolean;
13
- onClick?: () => void;
14
- runtimeType?: 'mcp' | 'default' | 'markdown' | 'standalone' | undefined;
15
- type: LobeToolType;
16
- }
17
-
18
- const Item = memo<PluginItemProps>(
19
- ({ title, description, avatar, onClick, active, identifier, author, runtimeType, type }) => {
20
- const isMCP = runtimeType === 'mcp';
21
-
22
- return (
23
- <Block
24
- align={'center'}
25
- clickable
26
- gap={8}
27
- horizontal
28
- justify={'space-between'}
29
- onClick={onClick}
30
- paddingBlock={8}
31
- paddingInline={12}
32
- style={{ position: 'relative' }}
33
- variant={active ? 'filled' : 'borderless'}
34
- >
35
- <Flexbox
36
- align={'center'}
37
- flex={1}
38
- gap={8}
39
- horizontal
40
- style={{ overflow: 'hidden', position: 'relative' }}
41
- >
42
- <PluginAvatar avatar={avatar} />
43
- <Flexbox flex={1} gap={4} style={{ overflow: 'hidden', position: 'relative' }}>
44
- <Flexbox align={'center'} gap={4} horizontal>
45
- <Text ellipsis strong>
46
- {title}
47
- </Text>
48
- <PluginTag author={author} isMCP={isMCP} type={type!} />
49
- </Flexbox>
50
- <Text ellipsis fontSize={12} type={'secondary'}>
51
- {description}
52
- </Text>
53
- </Flexbox>
54
- </Flexbox>
55
- <Actions identifier={identifier} isMCP={isMCP} type={type!} />
56
- </Block>
57
- );
58
- },
59
- );
60
-
61
- export default Item;
@@ -1,72 +0,0 @@
1
- import { Flexbox } from '@lobehub/ui';
2
- import isEqual from 'fast-deep-equal';
3
- import { memo, useMemo } from 'react';
4
- import { Virtuoso } from 'react-virtuoso';
5
-
6
- import { useToolStore } from '@/store/tool';
7
- import { pluginSelectors } from '@/store/tool/selectors';
8
- import { type LobeToolType } from '@/types/tool/tool';
9
-
10
- import PluginEmpty from '../../PluginEmpty';
11
- import PluginItem from './Item';
12
-
13
- interface ListProps {
14
- identifier?: string;
15
- keywords?: string;
16
- setIdentifier?: (props: {
17
- identifier?: string;
18
- runtimeType: 'mcp' | 'default';
19
- type?: LobeToolType;
20
- }) => void;
21
- }
22
-
23
- export const List = memo<ListProps>(({ keywords, identifier, setIdentifier }) => {
24
- const installedPlugins = useToolStore(pluginSelectors.installedPluginMetaList, isEqual);
25
-
26
- const filteredPluginList = useMemo(
27
- () =>
28
- installedPlugins.filter((item) =>
29
- [item?.title, item?.description, item.author, ...(item?.tags || [])]
30
- .filter(Boolean)
31
- .join('')
32
- .toLowerCase()
33
- .includes((keywords || '')?.toLowerCase()),
34
- ),
35
- [installedPlugins, keywords],
36
- );
37
-
38
- const isEmpty = installedPlugins.length === 0;
39
- const hasSearchKeywords = Boolean(keywords && keywords.trim());
40
-
41
- if (isEmpty) return <PluginEmpty search={hasSearchKeywords} />;
42
-
43
- return (
44
- <Virtuoso
45
- data={filteredPluginList}
46
- increaseViewportBy={typeof window !== 'undefined' ? window.innerHeight : 0}
47
- itemContent={(_, item) => {
48
- return (
49
- <Flexbox
50
- key={item.identifier}
51
- onClick={() => {
52
- setIdentifier?.({
53
- identifier: item.identifier,
54
- runtimeType: item.runtimeType as any,
55
- type: item.type,
56
- });
57
- }}
58
- paddingBlock={2}
59
- paddingInline={4}
60
- >
61
- <PluginItem active={identifier === item.identifier} {...(item as any)} />
62
- </Flexbox>
63
- );
64
- }}
65
- overscan={24}
66
- style={{ height: '100%', width: '100%' }}
67
- totalCount={filteredPluginList.length}
68
- />
69
- );
70
- });
71
-
72
- export default List;
@@ -1,90 +0,0 @@
1
- import { Center, DraggablePanel, Empty, Flexbox } from '@lobehub/ui';
2
- import { cssVar, useTheme } from 'antd-style';
3
- import { Plug2 } from 'lucide-react';
4
- import { memo, useRef, useState } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- import { useToolStore } from '@/store/tool';
8
- import { pluginSelectors } from '@/store/tool/selectors';
9
- import { type LobeToolType } from '@/types/tool/tool';
10
-
11
- import PluginEmpty from '../PluginEmpty';
12
- import Detail from './Detail';
13
- import List from './List';
14
-
15
- const PluginList = memo<{ keywords?: string }>(({ keywords }) => {
16
- const { t } = useTranslation('plugin');
17
- const ref = useRef<HTMLDivElement>(null);
18
-
19
- const [type, setType] = useState<LobeToolType>();
20
- const [runtimeType, setRuntimeType] = useState<'mcp' | 'default'>();
21
- const theme = useTheme(); // Keep for colorBgContainerSecondary (not in cssVar)
22
-
23
- const [identifier] = useToolStore((s) => [s.activePluginIdentifier]);
24
- const isEmpty = useToolStore((s) => pluginSelectors.installedPluginMetaList(s).length === 0);
25
-
26
- if (isEmpty)
27
- return (
28
- <Center height={'75vh'}>
29
- <PluginEmpty />
30
- </Center>
31
- );
32
-
33
- return (
34
- <Flexbox
35
- height={'75vh'}
36
- horizontal
37
- style={{
38
- borderTop: `1px solid ${cssVar.colorBorderSecondary}`,
39
- overflow: 'hidden',
40
- position: 'relative',
41
- }}
42
- width={'100%'}
43
- >
44
- <DraggablePanel maxWidth={1024} minWidth={420} placement={'left'}>
45
- <List
46
- identifier={identifier}
47
- keywords={keywords}
48
- setIdentifier={({ identifier, type, runtimeType }) => {
49
- useToolStore.setState({ activePluginIdentifier: identifier });
50
- setType(type);
51
- setRuntimeType(runtimeType);
52
- ref?.current?.scrollTo({ top: 0 });
53
- }}
54
- />
55
- </DraggablePanel>
56
- {identifier ? (
57
- <Flexbox
58
- height={'100%'}
59
- padding={16}
60
- ref={ref}
61
- style={{
62
- background: theme.colorBgContainerSecondary,
63
- overflowX: 'hidden',
64
- overflowY: 'auto',
65
- }}
66
- width={'100%'}
67
- >
68
- <Detail identifier={identifier} runtimeType={runtimeType} type={type} />
69
- </Flexbox>
70
- ) : (
71
- <Center
72
- height={'100%'}
73
- style={{
74
- background: theme.colorBgContainerSecondary,
75
- }}
76
- width={'100%'}
77
- >
78
- <Empty
79
- description={t('store.emptySelectHint')}
80
- descriptionProps={{ fontSize: 14 }}
81
- icon={Plug2}
82
- style={{ maxWidth: 400 }}
83
- />
84
- </Center>
85
- )}
86
- </Flexbox>
87
- );
88
- });
89
-
90
- export default PluginList;
@@ -1,119 +0,0 @@
1
- import { ActionIcon, Button, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
2
- import { App } from 'antd';
3
- import { MoreVerticalIcon, Trash2 } from 'lucide-react';
4
- import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
8
- import { useAgentStore } from '@/store/agent';
9
- import { agentSelectors } from '@/store/agent/selectors';
10
- import { useToolStore } from '@/store/tool';
11
- import { mcpStoreSelectors, pluginSelectors } from '@/store/tool/selectors';
12
-
13
- interface ActionsProps {
14
- identifier: string;
15
- }
16
-
17
- const Actions = memo<ActionsProps>(({ identifier }) => {
18
- const [installed, installing, unInstallPlugin, installMCPPlugin, cancelInstallMCPPlugin, plugin] =
19
- useToolStore((s) => [
20
- pluginSelectors.isPluginInstalled(identifier)(s),
21
- mcpStoreSelectors.isMCPInstalling(identifier)(s),
22
- s.uninstallPlugin,
23
- s.installMCPPlugin,
24
- s.cancelInstallMCPPlugin,
25
- mcpStoreSelectors.getPluginById(identifier)(s),
26
- ]);
27
-
28
- const { t } = useTranslation('plugin');
29
- const [togglePlugin, isPluginEnabledInAgent] = useAgentStore((s) => [
30
- s.togglePlugin,
31
- agentSelectors.currentAgentPlugins(s).includes(identifier),
32
- ]);
33
- const { modal } = App.useApp();
34
- const { isAuthenticated, signIn } = useMarketAuth();
35
-
36
- // Check if this is a cloud MCP plugin
37
- const isCloudMcp = !!((plugin as any)?.cloudEndPoint || (plugin as any)?.haveCloudEndpoint);
38
-
39
- return (
40
- <Flexbox align={'center'} horizontal>
41
- {installed ? (
42
- <DropdownMenu
43
- items={[
44
- {
45
- danger: true,
46
- icon: <Icon icon={Trash2} />,
47
- key: 'uninstall',
48
- label: t('store.actions.uninstall'),
49
- onClick: () => {
50
- modal.confirm({
51
- centered: true,
52
- okButtonProps: { danger: true },
53
- onOk: async () => {
54
- // If plugin is enabled in current agent, disable it first
55
- if (isPluginEnabledInAgent) {
56
- await togglePlugin(identifier, false);
57
- }
58
- await unInstallPlugin(identifier);
59
- },
60
- title: t('store.actions.confirmUninstall'),
61
- type: 'error',
62
- });
63
- },
64
- },
65
- ]}
66
- placement="bottomRight"
67
- >
68
- <ActionIcon
69
- icon={MoreVerticalIcon}
70
- loading={installing}
71
- onClick={(e) => {
72
- e.stopPropagation();
73
- }}
74
- />
75
- </DropdownMenu>
76
- ) : installing ? (
77
- <Button
78
- onClick={async (e) => {
79
- e.stopPropagation();
80
- await cancelInstallMCPPlugin(identifier);
81
- }}
82
- variant={'filled'}
83
- >
84
- {t('store.actions.cancel')}
85
- </Button>
86
- ) : (
87
- <Button
88
- onClick={async (e) => {
89
- e.stopPropagation();
90
-
91
- // If this is a cloud MCP and user is not authenticated, request authorization first
92
- if (isCloudMcp && !isAuthenticated) {
93
- console.log(
94
- '[MCPListAction] Cloud MCP detected, user not authenticated, starting authorization',
95
- );
96
-
97
- try {
98
- await signIn();
99
- } catch {
100
- return; // Don't proceed with installation if auth fails
101
- }
102
- }
103
-
104
- const isSuccess = await installMCPPlugin(identifier);
105
-
106
- if (isSuccess) {
107
- await togglePlugin(identifier);
108
- }
109
- }}
110
- variant={'filled'}
111
- >
112
- {t('store.actions.install')}
113
- </Button>
114
- )}
115
- </Flexbox>
116
- );
117
- });
118
-
119
- export default Actions;
@@ -1,83 +0,0 @@
1
- import { Block, Flexbox, Text } from '@lobehub/ui';
2
- import isEqual from 'fast-deep-equal';
3
- import { memo, useEffect, useRef } from 'react';
4
-
5
- import PluginAvatar from '@/components/Plugins/PluginAvatar';
6
- import MCPInstallProgress from '@/features/MCP/MCPInstallProgress';
7
- import { useToolStore } from '@/store/tool';
8
- import { mcpStoreSelectors } from '@/store/tool/selectors';
9
- import { type DiscoverMcpItem } from '@/types/discover';
10
- import { MCPInstallStep } from '@/types/plugins';
11
- import { type LobeToolType } from '@/types/tool/tool';
12
-
13
- import Actions from './Action';
14
-
15
- interface PluginItemProps extends DiscoverMcpItem {
16
- active?: boolean;
17
- setIdentifier: (identifier?: string) => void;
18
- type?: LobeToolType;
19
- }
20
-
21
- const Item = memo<PluginItemProps>(
22
- ({ name, description, icon, setIdentifier, active, identifier }) => {
23
- const installProgress = useToolStore(
24
- mcpStoreSelectors.getMCPInstallProgress(identifier),
25
- isEqual,
26
- );
27
-
28
- const needsConfig = installProgress?.needsConfig;
29
- const needsDependencies = installProgress?.step === MCPInstallStep.DEPENDENCIES_REQUIRED;
30
-
31
- const containerRef = useRef<HTMLButtonElement | null>(null);
32
-
33
- useEffect(() => {
34
- if ((!needsConfig && !needsDependencies) || !containerRef.current) return;
35
-
36
- containerRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
37
- }, [needsConfig, needsDependencies]);
38
-
39
- return (
40
- <Flexbox gap={0} ref={containerRef}>
41
- <Block
42
- align={'center'}
43
- clickable
44
- gap={16}
45
- horizontal
46
- justify={'space-between'}
47
- onClick={() => setIdentifier(identifier)}
48
- paddingBlock={8}
49
- paddingInline={12}
50
- style={{ position: 'relative' }}
51
- variant={active ? 'filled' : 'borderless'}
52
- >
53
- <Flexbox
54
- align={'center'}
55
- flex={1}
56
- gap={8}
57
- horizontal
58
- style={{ overflow: 'hidden', position: 'relative' }}
59
- >
60
- <PluginAvatar avatar={icon} />
61
- <Flexbox flex={1} gap={4} style={{ overflow: 'hidden', position: 'relative' }}>
62
- <Text ellipsis strong>
63
- {name}
64
- </Text>
65
- <Text ellipsis fontSize={12} type={'secondary'}>
66
- {description}
67
- </Text>
68
- </Flexbox>
69
- </Flexbox>
70
- <Actions identifier={identifier} />
71
- </Block>
72
-
73
- {!!installProgress && (
74
- <Flexbox paddingInline={12}>
75
- <MCPInstallProgress identifier={identifier} />
76
- </Flexbox>
77
- )}
78
- </Flexbox>
79
- );
80
- },
81
- );
82
-
83
- export default Item;
@@ -1,93 +0,0 @@
1
- import { Center, Flexbox, Icon } from '@lobehub/ui';
2
- import { ServerCrash } from 'lucide-react';
3
- import { memo, useEffect } from 'react';
4
- import { useTranslation } from 'react-i18next';
5
- import { Virtuoso } from 'react-virtuoso';
6
-
7
- import { useToolStore } from '@/store/tool';
8
-
9
- import SearchLoading from '../../Loading';
10
- import PluginEmpty from '../../PluginEmpty';
11
- import VirtuosoLoading from '../../VirtuosoLoading';
12
- import Item from './Item';
13
-
14
- interface ListProps {
15
- setIdentifier: (identifier?: string) => void;
16
- }
17
-
18
- export const List = memo<ListProps>(({ setIdentifier }) => {
19
- const { t } = useTranslation('plugin');
20
-
21
- const [
22
- isMcpListInit,
23
- identifier,
24
- allItems,
25
- totalCount,
26
- currentPage,
27
- keywords,
28
- searchLoading,
29
- useFetchMCPPluginList,
30
- loadMoreMCPPlugins,
31
- resetMCPPluginList,
32
- ] = useToolStore((s) => [
33
- s.isMcpListInit,
34
- s.activeMCPIdentifier,
35
- s.mcpPluginItems,
36
- s.totalCount,
37
- s.currentPage,
38
- s.mcpSearchKeywords,
39
- s.searchLoading,
40
- s.useFetchMCPPluginList,
41
- s.loadMoreMCPPlugins,
42
- s.resetMCPPluginList,
43
- ]);
44
-
45
- // 当 keywords 变化时重置列表
46
- useEffect(() => {
47
- resetMCPPluginList(keywords);
48
- }, [keywords, resetMCPPluginList]);
49
-
50
- const { isLoading, error } = useFetchMCPPluginList({
51
- page: currentPage,
52
- pageSize: 20,
53
- q: keywords,
54
- });
55
-
56
- if (searchLoading || !isMcpListInit) return <SearchLoading />;
57
-
58
- if (error)
59
- return (
60
- <Center gap={12} padding={40}>
61
- <Icon icon={ServerCrash} size={80} />
62
- {t('store.networkError')}
63
- </Center>
64
- );
65
-
66
- const isEmpty = allItems.length === 0;
67
- const hasSearchKeywords = Boolean(keywords && keywords.trim());
68
-
69
- if (isEmpty) return <PluginEmpty search={hasSearchKeywords} />;
70
-
71
- return (
72
- <Virtuoso
73
- components={{
74
- Footer: isLoading ? VirtuosoLoading : undefined,
75
- }}
76
- data={allItems}
77
- endReached={loadMoreMCPPlugins}
78
- increaseViewportBy={typeof window !== 'undefined' ? window.innerHeight : 0}
79
- itemContent={(_, item) => {
80
- return (
81
- <Flexbox key={item.identifier} paddingBlock={2} paddingInline={4}>
82
- <Item active={identifier === item.identifier} {...item} setIdentifier={setIdentifier} />
83
- </Flexbox>
84
- );
85
- }}
86
- overscan={24}
87
- style={{ height: '100%', width: '100%' }}
88
- totalCount={totalCount || 0}
89
- />
90
- );
91
- });
92
-
93
- export default List;
@@ -1,58 +0,0 @@
1
- import { DraggablePanel, Flexbox } from '@lobehub/ui';
2
- import { cssVar, useTheme } from 'antd-style';
3
- import dynamic from '@/libs/next/dynamic';
4
- import { memo, useRef } from 'react';
5
-
6
- import { useServerConfigStore } from '@/store/serverConfig';
7
- import { useToolStore } from '@/store/tool';
8
-
9
- import DetailLoading from './Detail/Loading';
10
- import List from './List';
11
-
12
- const Detail = dynamic(() => import('./Detail'), { loading: DetailLoading, ssr: false });
13
-
14
- export const MCPPluginList = memo(() => {
15
- const ref = useRef<HTMLDivElement>(null);
16
- const theme = useTheme(); // Keep for colorBgContainerSecondary (not in cssVar)
17
-
18
- const mobile = useServerConfigStore((s) => s.isMobile);
19
-
20
- return (
21
- <Flexbox
22
- height={'75vh'}
23
- horizontal
24
- style={{
25
- borderTop: `1px solid ${cssVar.colorBorderSecondary}`,
26
- overflow: 'hidden',
27
- position: 'relative',
28
- }}
29
- width={'100%'}
30
- >
31
- {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
32
- {/* @ts-ignore */}
33
- <DraggablePanel maxWidth={1024} minWidth={mobile ? '100vw' : 420} placement={'left'}>
34
- <List
35
- setIdentifier={(identifier) => {
36
- useToolStore.setState({ activeMCPIdentifier: identifier });
37
- ref?.current?.scrollTo({ top: 0 });
38
- }}
39
- />
40
- </DraggablePanel>
41
- <Flexbox
42
- height={'100%'}
43
- padding={16}
44
- ref={ref}
45
- style={{
46
- background: theme.colorBgContainerSecondary,
47
- overflowX: 'hidden',
48
- overflowY: 'auto',
49
- }}
50
- width={'100%'}
51
- >
52
- <Detail />
53
- </Flexbox>
54
- </Flexbox>
55
- );
56
- });
57
-
58
- export default MCPPluginList;
@@ -1,19 +0,0 @@
1
- 'use client';
2
-
3
- import { type ReactNode, createContext, memo, use } from 'react';
4
-
5
- import { type DiscoverPluginDetail } from '@/types/discover';
6
-
7
- export type DetailContextConfig = Partial<DiscoverPluginDetail>;
8
-
9
- export const DetailContext = createContext<DetailContextConfig>({});
10
-
11
- export const DetailProvider = memo<{ children: ReactNode; config?: DetailContextConfig }>(
12
- ({ children, config = {} }) => {
13
- return <DetailContext value={config}>{children}</DetailContext>;
14
- },
15
- );
16
-
17
- export const useDetailContext = () => {
18
- return use(DetailContext);
19
- };
@@ -1,56 +0,0 @@
1
- import { Center, Flexbox, Icon, Text } from '@lobehub/ui';
2
- import { createStaticStyles } from 'antd-style';
3
- import { Puzzle } from 'lucide-react';
4
- import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- const styles = createStaticStyles(({ css, cssVar }) => ({
8
- container: css`
9
- padding-block: ${cssVar.paddingXL};
10
- padding-inline: ${cssVar.paddingLG};
11
- `,
12
- description: css`
13
- max-width: 240px;
14
- line-height: 1.5;
15
- color: ${cssVar.colorTextSecondary};
16
- text-align: center;
17
- `,
18
- iconWrapper: css`
19
- display: flex;
20
- align-items: center;
21
- justify-content: center;
22
-
23
- width: 64px;
24
- height: 64px;
25
- margin-block-end: ${cssVar.marginMD};
26
- border-radius: 50%;
27
-
28
- background-color: ${cssVar.colorPrimaryBg};
29
- `,
30
- title: css`
31
- margin-block-end: ${cssVar.marginSM};
32
-
33
- font-size: ${cssVar.fontSizeLG};
34
- font-weight: 500;
35
- color: ${cssVar.colorText};
36
- text-align: center;
37
- `,
38
- }));
39
-
40
- const EmptyState = memo(() => {
41
- const { t } = useTranslation('plugin');
42
-
43
- return (
44
- <Center className={styles.container}>
45
- <Flexbox align="center">
46
- <div className={styles.iconWrapper}>
47
- <Icon icon={Puzzle} size={32} />
48
- </div>
49
- <Text className={styles.title}>{t('detailModal.emptyState.title')}</Text>
50
- <Text className={styles.description}>{t('detailModal.emptyState.description')}</Text>
51
- </Flexbox>
52
- </Center>
53
- );
54
- });
55
-
56
- export default EmptyState;