@lobehub/chat 1.96.20 → 1.97.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.
- package/CHANGELOG.md +25 -0
- package/apps/desktop/package.json +1 -1
- package/apps/desktop/src/main/core/Browser.ts +2 -1
- package/apps/desktop/src/main/utils/next-electron-rsc.ts +15 -8
- package/changelog/v1.json +9 -0
- package/locales/ar/discover.json +452 -12
- package/locales/ar/metadata.json +4 -0
- package/locales/ar/plugin.json +89 -2
- package/locales/ar/setting.json +1 -0
- package/locales/bg-BG/discover.json +452 -12
- package/locales/bg-BG/metadata.json +4 -0
- package/locales/bg-BG/plugin.json +89 -2
- package/locales/bg-BG/setting.json +1 -0
- package/locales/de-DE/discover.json +452 -12
- package/locales/de-DE/metadata.json +4 -0
- package/locales/de-DE/plugin.json +89 -2
- package/locales/de-DE/setting.json +1 -0
- package/locales/en-US/discover.json +452 -12
- package/locales/en-US/metadata.json +4 -0
- package/locales/en-US/plugin.json +89 -2
- package/locales/en-US/setting.json +1 -0
- package/locales/es-ES/discover.json +452 -12
- package/locales/es-ES/metadata.json +4 -0
- package/locales/es-ES/plugin.json +89 -2
- package/locales/es-ES/setting.json +1 -0
- package/locales/fa-IR/discover.json +452 -12
- package/locales/fa-IR/metadata.json +4 -0
- package/locales/fa-IR/plugin.json +89 -2
- package/locales/fa-IR/setting.json +1 -0
- package/locales/fr-FR/discover.json +452 -12
- package/locales/fr-FR/metadata.json +4 -0
- package/locales/fr-FR/plugin.json +89 -2
- package/locales/fr-FR/setting.json +1 -0
- package/locales/it-IT/discover.json +452 -12
- package/locales/it-IT/metadata.json +4 -0
- package/locales/it-IT/plugin.json +89 -2
- package/locales/it-IT/setting.json +1 -0
- package/locales/ja-JP/discover.json +452 -12
- package/locales/ja-JP/metadata.json +4 -0
- package/locales/ja-JP/plugin.json +89 -2
- package/locales/ja-JP/setting.json +1 -0
- package/locales/ko-KR/discover.json +452 -12
- package/locales/ko-KR/metadata.json +4 -0
- package/locales/ko-KR/plugin.json +89 -2
- package/locales/ko-KR/setting.json +1 -0
- package/locales/nl-NL/discover.json +452 -12
- package/locales/nl-NL/metadata.json +4 -0
- package/locales/nl-NL/plugin.json +89 -2
- package/locales/nl-NL/setting.json +1 -0
- package/locales/pl-PL/discover.json +452 -12
- package/locales/pl-PL/metadata.json +4 -0
- package/locales/pl-PL/plugin.json +89 -2
- package/locales/pl-PL/setting.json +1 -0
- package/locales/pt-BR/discover.json +452 -12
- package/locales/pt-BR/metadata.json +4 -0
- package/locales/pt-BR/plugin.json +89 -2
- package/locales/pt-BR/setting.json +1 -0
- package/locales/ru-RU/discover.json +452 -12
- package/locales/ru-RU/metadata.json +4 -0
- package/locales/ru-RU/plugin.json +89 -2
- package/locales/ru-RU/setting.json +1 -0
- package/locales/tr-TR/discover.json +452 -12
- package/locales/tr-TR/metadata.json +4 -0
- package/locales/tr-TR/plugin.json +89 -2
- package/locales/tr-TR/setting.json +1 -0
- package/locales/vi-VN/discover.json +452 -12
- package/locales/vi-VN/metadata.json +4 -0
- package/locales/vi-VN/plugin.json +89 -2
- package/locales/vi-VN/setting.json +1 -0
- package/locales/zh-CN/discover.json +452 -12
- package/locales/zh-CN/metadata.json +8 -4
- package/locales/zh-CN/plugin.json +89 -2
- package/locales/zh-CN/setting.json +1 -0
- package/locales/zh-TW/discover.json +452 -12
- package/locales/zh-TW/metadata.json +4 -0
- package/locales/zh-TW/plugin.json +89 -2
- package/locales/zh-TW/setting.json +1 -0
- package/next.config.ts +70 -19
- package/package.json +6 -2
- package/scripts/buildSitemapIndex/index.ts +9 -4
- package/src/app/(backend)/trpc/lambda/[trpc]/route.ts +5 -0
- package/src/app/[variants]/(main)/_layout/Mobile/index.tsx +5 -4
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/InboxWelcome/AgentsSuggest.tsx +31 -45
- package/src/app/[variants]/(main)/discover/(detail)/_layout/Desktop.tsx +8 -6
- package/src/app/[variants]/(main)/discover/(detail)/_layout/Mobile/Header.tsx +3 -2
- package/src/app/[variants]/(main)/discover/(detail)/_layout/Mobile/index.tsx +5 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/Client.tsx +40 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/DetailProvider.tsx +19 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Capabilities/Block.tsx +27 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Capabilities/Knowledge.tsx +33 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Capabilities/KnowledgeItem.tsx +58 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Capabilities/PluginItem.tsx +68 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Capabilities/Plugins.tsx +32 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Capabilities/index.tsx +37 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Nav.tsx +121 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Overview/TagList.tsx +47 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Overview/index.tsx +96 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/Related/index.tsx +31 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/SystemRole/TagList.tsx +47 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/SystemRole/index.tsx +54 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Details/index.tsx +49 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Header.tsx +176 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[slug]/features → [...slugs]/features/Sidebar/ActionButton}/AddAgent.tsx +22 -21
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/ActionButton/index.tsx +31 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/Related/Item.tsx +57 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/Related/index.tsx +43 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/Summary/index.tsx +38 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/TocList/index.tsx +77 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/features/Sidebar/index.tsx +46 -0
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/loading.tsx +48 -0
- package/src/app/[variants]/(main)/discover/(detail)/{plugin/[slug] → assistant/[...slugs]}/page.tsx +39 -42
- package/src/app/[variants]/(main)/discover/(detail)/features/Breadcrumb.tsx +56 -0
- package/src/app/[variants]/(main)/discover/(detail)/features/DetailLayout.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/features/MakedownRender.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(detail)/features/ShareButton.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(detail)/features/Toc/Heading.tsx +108 -0
- package/src/app/[variants]/(main)/discover/(detail)/features/Toc/index.tsx +92 -0
- package/src/app/[variants]/(main)/discover/(detail)/features/Toc/useToc.tsx +66 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/Client.tsx +43 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Details/Related/index.tsx +32 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Details/Versions/index.tsx +76 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Details/index.tsx +59 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/ActionButton/index.tsx +84 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/ConnectionTypeAlert.tsx +35 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/Related/Item.tsx +57 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/Related/index.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/ServerConfig.tsx +36 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/TocList/index.tsx +98 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/features/Sidebar/index.tsx +58 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/page.tsx +103 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/Client.tsx +40 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/DetailProvider.tsx +19 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Nav.tsx +90 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Overview/ProviderList/index.tsx +179 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Overview/index.tsx +22 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/{ParameterList → Details/Parameter}/ParameterItem.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/{ParameterList → Details/Parameter}/index.tsx +11 -11
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Related/index.tsx +31 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/index.tsx +47 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Header.tsx +84 -59
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/ActionButton/ChatWithModel.tsx +92 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/ActionButton/index.tsx +32 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/Related/Item.tsx +60 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/Related/index.tsx +43 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/RelatedProviders/Item.tsx +60 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/RelatedProviders/index.tsx +34 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Sidebar/index.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/page.tsx +22 -45
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/Client.tsx +40 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/DetailProvider.tsx +19 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Guide/index.tsx +25 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Nav.tsx +99 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Overview/ModelList/index.tsx +142 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Overview/index.tsx +23 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Related/index.tsx +22 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/index.tsx +47 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Header.tsx +99 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[slug]/features → [...slugs]/features/Sidebar/ActionButton}/ProviderConfig.tsx +9 -14
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[slug]/features/Actions.tsx → [...slugs]/features/Sidebar/ActionButton/index.tsx} +14 -18
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/Related/Item.tsx +60 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/Related/index.tsx +34 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/RelatedModels/Item.tsx +60 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/RelatedModels/index.tsx +43 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/index.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/page.tsx +103 -0
- package/src/app/[variants]/(main)/discover/(list)/(home)/Client.tsx +24 -21
- package/src/app/[variants]/(main)/discover/(list)/(home)/loading.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/(home)/page.tsx +13 -38
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/Nav.tsx +15 -8
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/Header.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/Nav.tsx +2 -1
- package/src/app/[variants]/(main)/discover/(list)/assistant/Client.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/Category/index.tsx +84 -0
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/Category/useCategory.tsx +112 -0
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/Item.tsx +189 -0
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/TokenTag.tsx +70 -0
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/index.tsx +33 -0
- package/src/app/[variants]/(main)/discover/(list)/assistant/page.tsx +46 -0
- package/src/app/[variants]/(main)/discover/(list)/features/Pagination.tsx +67 -0
- package/src/app/[variants]/(main)/discover/(list)/features/SortButton/index.tsx +184 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/Client.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/Category/index.tsx +83 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/ConnectionTypeTag.tsx +51 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/Item.tsx +225 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/MetaInfo.tsx +33 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/index.tsx +33 -0
- package/src/app/[variants]/(main)/discover/(list)/mcp/page.tsx +46 -0
- package/src/app/[variants]/(main)/discover/(list)/model/Client.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(list)/{models → model}/_layout/Desktop.tsx +1 -7
- package/src/app/[variants]/(main)/discover/(list)/model/features/Category/index.tsx +82 -0
- package/src/app/[variants]/(main)/discover/(list)/model/features/Category/useCategory.tsx +41 -0
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/Item.tsx +190 -0
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/ModelTypeIcon.tsx +39 -0
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/index.tsx +33 -0
- package/src/app/[variants]/(main)/discover/(list)/model/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(list)/model/page.tsx +44 -0
- package/src/app/[variants]/(main)/discover/(list)/provider/Client.tsx +43 -0
- package/src/app/[variants]/(main)/discover/(list)/provider/features/List/Item.tsx +136 -0
- package/src/app/[variants]/(main)/discover/(list)/provider/features/List/index.tsx +33 -0
- package/src/app/[variants]/(main)/discover/(list)/provider/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(list)/provider/page.tsx +44 -0
- package/src/app/[variants]/(main)/discover/_layout/Desktop/Header.tsx +1 -1
- package/src/app/[variants]/(main)/discover/components/CategoryContainer.tsx +7 -5
- package/src/app/[variants]/(main)/discover/components/CategoryMenu.tsx +28 -30
- package/src/app/[variants]/(main)/discover/components/ListLoading.tsx +56 -46
- package/src/app/[variants]/(main)/discover/components/Statistic.tsx +5 -6
- package/src/app/[variants]/(main)/discover/features/Search.tsx +62 -0
- package/src/app/[variants]/(main)/discover/features/Title.tsx +83 -0
- package/src/app/[variants]/(main)/discover/features/__tests__/calculateScore.test.ts +185 -0
- package/src/app/[variants]/(main)/discover/features/useNav.tsx +32 -12
- package/src/app/robots.tsx +7 -5
- package/src/app/sitemap.tsx +81 -13
- package/src/components/CopyableLabel/index.tsx +37 -0
- package/src/components/Descriptions/index.tsx +119 -0
- package/src/components/InlineTable/index.tsx +69 -0
- package/src/{features/PluginSettings/PluginSettingRender.tsx → components/JSONSchemaConfig/ItemRender.tsx} +3 -3
- package/src/components/MCPDepsIcon/Java.tsx +23 -0
- package/src/components/MCPDepsIcon/PowerShell.tsx +23 -0
- package/src/components/MCPDepsIcon/Terminal.tsx +23 -0
- package/src/components/MCPDepsIcon/UV.tsx +23 -0
- package/src/components/MCPDepsIcon/index.tsx +72 -0
- package/src/components/MCPStdioCommandInput/index.tsx +47 -0
- package/src/components/OfficialIcon.tsx +23 -0
- package/src/components/Plugins/MCPTag.tsx +18 -0
- package/src/components/Plugins/PluginTag.tsx +50 -0
- package/src/components/PublishedTime.tsx +71 -0
- package/src/config/__tests__/app.test.ts +6 -2
- package/src/const/discover.ts +8 -34
- package/src/database/models/message.ts +1 -0
- package/src/database/models/plugin.ts +13 -3
- package/src/envs/app.ts +1 -1
- package/src/features/AgentSetting/AgentPlugin/index.tsx +2 -2
- package/src/features/ChatInput/ActionBar/Tools/ToolItem.tsx +1 -1
- package/src/features/ChatInput/ActionBar/Tools/useControls.tsx +5 -5
- package/src/features/Conversation/Messages/Assistant/Tool/Inspector/index.tsx +25 -11
- package/src/features/MCP/MCPInstallProgress/InstallError/ErrorDetails.tsx +110 -0
- package/src/features/MCP/MCPInstallProgress/InstallError/index.tsx +51 -0
- package/src/features/MCP/MCPInstallProgress/MCPConfigForm.tsx +151 -0
- package/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx +217 -0
- package/src/features/MCP/MCPInstallProgress/index.tsx +118 -0
- package/src/features/MCP/Scores.tsx +268 -0
- package/src/features/MCP/calculateScore.ts +324 -0
- package/src/features/MCP/useScoreList.ts +126 -0
- package/src/features/MCP/utils.ts +225 -0
- package/src/features/MCPPluginDetail/CollapseDesc.tsx +44 -0
- package/src/features/MCPPluginDetail/CollapseLayout.tsx +34 -0
- package/src/features/MCPPluginDetail/Deployment/Platform/index.tsx +47 -0
- package/src/features/MCPPluginDetail/Deployment/index.tsx +322 -0
- package/src/features/MCPPluginDetail/DetailProvider.tsx +19 -0
- package/src/features/MCPPluginDetail/Header.tsx +218 -0
- package/src/features/MCPPluginDetail/Nav.tsx +196 -0
- package/src/features/MCPPluginDetail/Overview/TagList.tsx +47 -0
- package/src/features/MCPPluginDetail/Overview/index.tsx +57 -0
- package/src/features/MCPPluginDetail/Schema/Block.tsx +50 -0
- package/src/features/MCPPluginDetail/Schema/Prompts.tsx +125 -0
- package/src/features/MCPPluginDetail/Schema/Resources.tsx +70 -0
- package/src/features/MCPPluginDetail/Schema/Tools.tsx +146 -0
- package/src/features/MCPPluginDetail/Schema/index.tsx +63 -0
- package/src/features/MCPPluginDetail/Schema/style.ts +9 -0
- package/src/features/MCPPluginDetail/Schema/types.ts +4 -0
- package/src/features/MCPPluginDetail/Score/GithubBadge/index.tsx +82 -0
- package/src/features/MCPPluginDetail/Score/ScoreItem.tsx +34 -0
- package/src/features/MCPPluginDetail/Score/ScoreList.tsx +24 -0
- package/src/features/MCPPluginDetail/Score/TotalScore.tsx +289 -0
- package/src/features/MCPPluginDetail/Score/index.tsx +88 -0
- package/src/features/PluginAvatar/index.tsx +1 -1
- package/src/features/PluginDetailModal/Meta.tsx +3 -4
- package/src/features/PluginDevModal/MCPManifestForm/MCPTypeSelect.tsx +3 -4
- package/src/features/PluginDevModal/MCPManifestForm/index.tsx +4 -41
- package/src/features/PluginDevModal/PluginPreview/EmptyState.tsx +5 -7
- package/src/features/PluginDevModal/PluginPreview/index.tsx +6 -6
- package/src/features/PluginSettings/index.tsx +2 -2
- package/src/features/PluginStore/AddPluginButton.tsx +1 -1
- package/src/features/PluginStore/Content.tsx +59 -0
- package/src/features/PluginStore/InstalledList/Detail/CustomPluginEmptyState.tsx +81 -0
- package/src/features/PluginStore/InstalledList/Detail/index.tsx +21 -0
- package/src/features/PluginStore/InstalledList/EditCustomPlugin.tsx +52 -0
- package/src/features/PluginStore/{PluginItem → InstalledList/List/Item}/Action.tsx +33 -13
- package/src/features/PluginStore/InstalledList/List/Item/index.tsx +62 -0
- package/src/features/PluginStore/InstalledList/List/index.tsx +77 -0
- package/src/features/PluginStore/InstalledList/index.tsx +85 -0
- package/src/features/PluginStore/Loading.tsx +2 -2
- package/src/features/PluginStore/McpList/Detail/Loading.tsx +44 -0
- package/src/features/PluginStore/McpList/Detail/Settings/index.tsx +381 -0
- package/src/features/PluginStore/McpList/Detail/index.tsx +71 -0
- package/src/features/PluginStore/McpList/List/Action.tsx +94 -0
- package/src/features/PluginStore/McpList/List/Item.tsx +84 -0
- package/src/features/PluginStore/McpList/List/index.tsx +97 -0
- package/src/features/PluginStore/McpList/index.tsx +54 -0
- package/src/features/PluginStore/PluginList/Detail/DetailProvider.tsx +19 -0
- package/src/features/PluginStore/PluginList/Detail/EmptyState.tsx +58 -0
- package/src/features/PluginStore/PluginList/Detail/Header.tsx +132 -0
- package/src/features/PluginStore/PluginList/Detail/InstallDetail/Nav.tsx +75 -0
- package/src/features/PluginStore/PluginList/Detail/InstallDetail/Settings.tsx +19 -0
- package/src/features/PluginStore/PluginList/Detail/InstallDetail/Tools.tsx +109 -0
- package/src/features/PluginStore/PluginList/Detail/InstallDetail/index.tsx +24 -0
- package/src/features/PluginStore/PluginList/Detail/Loading.tsx +44 -0
- package/src/features/PluginStore/PluginList/Detail/TagList.tsx +37 -0
- package/src/features/PluginStore/PluginList/Detail/index.tsx +39 -0
- package/src/features/PluginStore/PluginList/Detail/useCategory.tsx +76 -0
- package/src/features/PluginStore/PluginList/List/Action.tsx +72 -0
- package/src/features/PluginStore/PluginList/List/Item.tsx +94 -0
- package/src/features/PluginStore/PluginList/List/index.tsx +91 -0
- package/src/features/PluginStore/PluginList/index.tsx +47 -0
- package/src/features/PluginStore/Search/index.tsx +29 -0
- package/src/features/PluginStore/VirtuosoLoading.tsx +16 -0
- package/src/features/PluginStore/index.tsx +7 -31
- package/src/features/PluginTag/index.tsx +6 -4
- package/src/hooks/useInterceptingRoutes.test.ts +6 -0
- package/src/hooks/useMCPCategory.tsx +133 -0
- package/src/hooks/useQuery.ts +8 -0
- package/src/hooks/useQueryRoute.test.ts +7 -0
- package/src/hooks/useQueryRoute.ts +5 -3
- package/src/libs/mcp/client.ts +255 -11
- package/src/libs/mcp/types.ts +99 -0
- package/src/libs/trpc/client/desktop.ts +2 -3
- package/src/libs/trpc/lambda/context.ts +36 -5
- package/src/libs/trpc/lambda/index.ts +1 -1
- package/src/libs/trpc/lambda/init.ts +8 -1
- package/src/locales/default/discover.ts +457 -12
- package/src/locales/default/metadata.ts +9 -4
- package/src/locales/default/plugin.ts +89 -1
- package/src/locales/default/setting.ts +1 -0
- package/src/locales/resources.ts +1 -1
- package/src/middleware.ts +13 -3
- package/src/server/ld.ts +4 -3
- package/src/server/modules/AssistantStore/index.test.ts +10 -8
- package/src/server/modules/AssistantStore/index.ts +37 -17
- package/src/server/modules/PluginStore/index.test.ts +1 -1
- package/src/server/modules/PluginStore/index.ts +24 -1
- package/src/server/routers/desktop/mcp.ts +36 -2
- package/src/server/routers/edge/index.ts +0 -6
- package/src/server/routers/{edge → lambda}/config/index.ts +1 -1
- package/src/server/routers/lambda/index.ts +4 -0
- package/src/server/routers/lambda/market/index.ts +621 -0
- package/src/server/routers/lambda/plugin.ts +2 -0
- package/src/server/routers/tools/mcp.ts +22 -0
- package/src/server/services/discover/index.test.ts +573 -250
- package/src/server/services/discover/index.ts +1096 -241
- package/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts +238 -0
- package/src/server/services/mcp/deps/checkers/ManualInstallationChecker.ts +20 -0
- package/src/server/services/mcp/deps/checkers/NpmInstallationChecker.ts +51 -0
- package/src/server/services/mcp/deps/checkers/PythonInstallationChecker.ts +69 -0
- package/src/server/services/mcp/deps/index.ts +14 -0
- package/src/server/services/mcp/deps/types.ts +49 -0
- package/src/server/services/mcp/index.ts +251 -33
- package/src/server/sitemap.test.ts +203 -46
- package/src/server/sitemap.ts +159 -52
- package/src/services/__tests__/global.test.ts +4 -7
- package/src/services/__tests__/tool.test.ts +1 -29
- package/src/services/discover.ts +365 -0
- package/src/services/global.ts +3 -3
- package/src/services/mcp.ts +131 -10
- package/src/services/plugin/_deprecated.ts +1 -1
- package/src/services/plugin/type.ts +3 -1
- package/src/services/tool.ts +9 -6
- package/src/store/chat/slices/plugin/action.test.ts +2 -3
- package/src/store/chat/slices/plugin/action.ts +22 -4
- package/src/store/discover/index.ts +1 -0
- package/src/store/discover/slices/assistant/action.ts +73 -0
- package/src/store/discover/slices/assistant/index.ts +1 -0
- package/src/store/discover/slices/mcp/action.ts +70 -0
- package/src/store/discover/slices/mcp/index.ts +1 -0
- package/src/store/discover/slices/model/action.ts +70 -0
- package/src/store/discover/slices/model/index.ts +1 -0
- package/src/store/discover/slices/plugin/action.ts +76 -0
- package/src/store/discover/slices/plugin/index.ts +1 -0
- package/src/store/discover/slices/provider/action.ts +61 -0
- package/src/store/discover/slices/provider/index.ts +1 -0
- package/src/store/discover/store.ts +39 -0
- package/src/store/tool/initialState.ts +8 -2
- package/src/store/tool/selectors/index.ts +2 -1
- package/src/store/tool/selectors/tool.test.ts +3 -1
- package/src/store/tool/selectors/tool.ts +14 -2
- package/src/store/tool/slices/mcpStore/action.ts +496 -0
- package/src/store/tool/slices/mcpStore/initialState.ts +40 -0
- package/src/store/tool/slices/mcpStore/selectors.ts +62 -0
- package/src/store/tool/slices/{store → oldStore}/action.test.ts +24 -19
- package/src/store/tool/slices/oldStore/action.ts +269 -0
- package/src/store/tool/slices/oldStore/index.ts +3 -0
- package/src/store/tool/slices/oldStore/initialState.ts +54 -0
- package/src/store/tool/slices/{store → oldStore}/selectors.test.ts +6 -3
- package/src/store/tool/slices/{store → oldStore}/selectors.ts +18 -5
- package/src/store/tool/slices/plugin/action.test.ts +2 -1
- package/src/store/tool/slices/plugin/action.ts +22 -4
- package/src/store/tool/slices/plugin/selectors.test.ts +12 -4
- package/src/store/tool/slices/plugin/selectors.ts +20 -9
- package/src/store/tool/store.ts +5 -2
- package/src/types/discover/assistants.ts +72 -0
- package/src/types/discover/index.ts +41 -0
- package/src/types/discover/mcp.ts +59 -0
- package/src/types/discover/models.ts +51 -0
- package/src/types/discover/plugins.ts +52 -0
- package/src/types/discover/providers.ts +47 -0
- package/src/types/message/tools.ts +3 -0
- package/src/types/plugins/index.ts +53 -0
- package/src/types/plugins/mcp.ts +188 -0
- package/src/types/plugins/mcpDeps.ts +30 -0
- package/src/types/tool/index.ts +10 -0
- package/src/types/tool/plugin.ts +3 -2
- package/src/types/tool/tool.ts +4 -1
- package/src/utils/client/cookie.ts +5 -2
- package/src/utils/locale.ts +2 -17
- package/src/utils/object.ts +10 -0
- package/src/utils/server/pageProps.ts +9 -0
- package/src/utils/toolCall.ts +5 -1
- package/src/utils/toolManifest.ts +1 -2
- package/vercel.json +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/Actions.tsx +0 -35
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/TopicList.tsx +0 -75
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/index.tsx +0 -105
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/Header.tsx +0 -115
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/SuggestionItem.tsx +0 -62
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/ToolItem.tsx +0 -19
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/index.tsx +0 -60
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/SystemRole.tsx +0 -35
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/features/Temp.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[slug]/page.tsx +0 -124
- package/src/app/[variants]/(main)/discover/(detail)/loading.tsx +0 -38
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Actions.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/ChatWithModel.tsx +0 -93
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/SuggestionItem.tsx +0 -74
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/index.tsx +0 -45
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/ProviderItem.tsx +0 -139
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/index.tsx +0 -45
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/Actions.tsx +0 -35
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/Header.tsx +0 -119
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/SuggestionItem.tsx +0 -64
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/index.tsx +0 -45
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/InstallPlugin.tsx +0 -83
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/ParameterList.tsx +0 -95
- package/src/app/[variants]/(main)/discover/(detail)/plugin/[slug]/features/Schema.tsx +0 -23
- package/src/app/[variants]/(main)/discover/(detail)/provider/[slug]/features/Header.tsx +0 -73
- package/src/app/[variants]/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +0 -77
- package/src/app/[variants]/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/index.tsx +0 -45
- package/src/app/[variants]/(main)/discover/(detail)/provider/[slug]/features/ModelList/ModelItem.tsx +0 -152
- package/src/app/[variants]/(main)/discover/(detail)/provider/[slug]/features/ModelList/index.tsx +0 -60
- package/src/app/[variants]/(main)/discover/(detail)/provider/[slug]/page.tsx +0 -126
- package/src/app/[variants]/(main)/discover/(list)/(home)/features/AssistantList.tsx +0 -33
- package/src/app/[variants]/(main)/discover/(list)/(home)/features/ModelList.tsx +0 -19
- package/src/app/[variants]/(main)/discover/(list)/(home)/features/PluginList.tsx +0 -25
- package/src/app/[variants]/(main)/discover/(list)/assistants/[slug]/page.tsx +0 -75
- package/src/app/[variants]/(main)/discover/(list)/assistants/features/Card.tsx +0 -195
- package/src/app/[variants]/(main)/discover/(list)/assistants/features/Category.tsx +0 -48
- package/src/app/[variants]/(main)/discover/(list)/assistants/features/List.tsx +0 -98
- package/src/app/[variants]/(main)/discover/(list)/assistants/features/useCategory.tsx +0 -116
- package/src/app/[variants]/(main)/discover/(list)/assistants/page.tsx +0 -64
- package/src/app/[variants]/(main)/discover/(list)/loading.tsx +0 -39
- package/src/app/[variants]/(main)/discover/(list)/models/[slug]/page.tsx +0 -78
- package/src/app/[variants]/(main)/discover/(list)/models/features/Card.tsx +0 -118
- package/src/app/[variants]/(main)/discover/(list)/models/features/Category.tsx +0 -67
- package/src/app/[variants]/(main)/discover/(list)/models/features/List.tsx +0 -71
- package/src/app/[variants]/(main)/discover/(list)/models/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(list)/models/page.tsx +0 -73
- package/src/app/[variants]/(main)/discover/(list)/plugins/[slug]/page.tsx +0 -75
- package/src/app/[variants]/(main)/discover/(list)/plugins/features/Card.tsx +0 -161
- package/src/app/[variants]/(main)/discover/(list)/plugins/features/Category.tsx +0 -45
- package/src/app/[variants]/(main)/discover/(list)/plugins/features/List.tsx +0 -97
- package/src/app/[variants]/(main)/discover/(list)/plugins/features/useCategory.tsx +0 -80
- package/src/app/[variants]/(main)/discover/(list)/plugins/page.tsx +0 -64
- package/src/app/[variants]/(main)/discover/(list)/providers/features/Card.tsx +0 -119
- package/src/app/[variants]/(main)/discover/(list)/providers/features/List.tsx +0 -67
- package/src/app/[variants]/(main)/discover/(list)/providers/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(list)/providers/page.tsx +0 -64
- package/src/app/[variants]/(main)/discover/features/StoreSearchBar.tsx +0 -87
- package/src/app/[variants]/(main)/discover/loading.tsx +0 -3
- package/src/app/[variants]/(main)/discover/search/_layout/Desktop.tsx +0 -42
- package/src/app/[variants]/(main)/discover/search/_layout/Mobile/Header.tsx +0 -31
- package/src/app/[variants]/(main)/discover/search/_layout/Mobile/Nav.tsx +0 -56
- package/src/app/[variants]/(main)/discover/search/_layout/Mobile/index.tsx +0 -32
- package/src/app/[variants]/(main)/discover/search/features/AssistantsResult.tsx +0 -27
- package/src/app/[variants]/(main)/discover/search/features/Category.tsx +0 -41
- package/src/app/[variants]/(main)/discover/search/features/ModelsResult.tsx +0 -27
- package/src/app/[variants]/(main)/discover/search/features/PluginsResult.tsx +0 -27
- package/src/app/[variants]/(main)/discover/search/features/ProvidersResult.tsx +0 -26
- package/src/app/[variants]/(main)/discover/search/layout.tsx +0 -12
- package/src/app/[variants]/(main)/discover/search/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/search/page.tsx +0 -82
- package/src/features/PluginStore/InstalledPluginList.tsx +0 -59
- package/src/features/PluginStore/OnlineList.tsx +0 -87
- package/src/features/PluginStore/PluginItem/EditCustomPlugin.tsx +0 -55
- package/src/features/PluginStore/PluginItem/PluginTag.tsx +0 -29
- package/src/features/PluginStore/PluginItem/index.tsx +0 -83
- package/src/server/routers/edge/market/index.ts +0 -108
- package/src/services/__tests__/assistant.test.ts +0 -87
- package/src/services/assistant.ts +0 -25
- package/src/store/tool/slices/store/action.ts +0 -113
- package/src/store/tool/slices/store/initialState.ts +0 -17
- package/src/types/discover.ts +0 -179
- package/src/types/requestCache.ts +0 -3
- /package/src/app/[variants]/(main)/discover/(list)/{assistants → assistant}/_layout/Desktop.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{assistants → assistant}/_layout/Mobile.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{assistants → assistant}/layout.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{assistants → assistant}/loading.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{plugins → mcp}/_layout/Desktop.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{plugins → mcp}/_layout/Mobile.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{plugins → mcp}/layout.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{plugins → mcp}/loading.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{models → model}/_layout/Mobile.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{models → model}/features/const.ts +0 -0
- /package/src/app/[variants]/(main)/discover/(list)/{models → model}/layout.tsx +0 -0
- /package/src/{features/PluginStore/PluginItem → components/Plugins}/PluginAvatar.tsx +0 -0
- /package/src/server/routers/{edge → lambda}/config/__snapshots__/index.test.ts.snap +0 -0
- /package/src/server/routers/{edge → lambda}/config/index.test.ts +0 -0
- /package/src/store/tool/slices/{store → mcpStore}/index.ts +0 -0
package/src/app/sitemap.tsx
CHANGED
@@ -1,30 +1,98 @@
|
|
1
1
|
import { MetadataRoute } from 'next';
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { LAST_MODIFIED, Sitemap, SitemapType } from '@/server/sitemap';
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
};
|
5
|
+
// Sitemap缓存配置 - 24小时重新验证
|
6
|
+
export const revalidate = 86_400; // 24小时 - 内容页面缓存
|
7
|
+
export const dynamic = 'force-static';
|
9
8
|
|
10
|
-
const
|
11
|
-
|
9
|
+
export const generateSitemapLink = (url: string) =>
|
10
|
+
['<sitemap>', `<loc>${url}</loc>`, `<lastmod>${LAST_MODIFIED}</lastmod>`, '</sitemap>'].join(
|
11
|
+
'\n',
|
12
|
+
);
|
13
|
+
|
14
|
+
export async function generateSitemaps() {
|
15
|
+
const sitemapModule = new Sitemap();
|
16
|
+
// 生成动态的sitemap列表,包括分页的sitemap
|
17
|
+
const staticSitemaps = sitemapModule.sitemapIndexs;
|
18
|
+
|
19
|
+
// 获取需要分页的类型的页数
|
20
|
+
const [pluginPages, assistantPages, mcpPages, modelPages] = await Promise.all([
|
21
|
+
sitemapModule.getPluginPageCount(),
|
22
|
+
sitemapModule.getAssistantPageCount(),
|
23
|
+
sitemapModule.getMcpPageCount(),
|
24
|
+
sitemapModule.getModelPageCount(),
|
25
|
+
]);
|
26
|
+
|
27
|
+
// 生成分页sitemap ID列表
|
28
|
+
const paginatedSitemaps = [
|
29
|
+
...Array.from({ length: pluginPages }, (_, i) => ({ id: `plugins-${i + 1}` as SitemapType })),
|
30
|
+
...Array.from({ length: assistantPages }, (_, i) => ({
|
31
|
+
id: `assistants-${i + 1}` as SitemapType,
|
32
|
+
})),
|
33
|
+
...Array.from({ length: mcpPages }, (_, i) => ({ id: `mcp-${i + 1}` as SitemapType })),
|
34
|
+
...Array.from({ length: modelPages }, (_, i) => ({ id: `models-${i + 1}` as SitemapType })),
|
35
|
+
];
|
36
|
+
|
37
|
+
return [...staticSitemaps, ...paginatedSitemaps];
|
38
|
+
}
|
39
|
+
|
40
|
+
// 解析分页ID
|
41
|
+
export function parsePaginatedId(id: string): { page?: number; type: SitemapType } {
|
42
|
+
if (id.includes('-')) {
|
43
|
+
const [type, pageStr] = id.split('-');
|
44
|
+
const page = parseInt(pageStr, 10);
|
45
|
+
if (!isNaN(page)) {
|
46
|
+
return { page, type: type as SitemapType };
|
47
|
+
}
|
48
|
+
}
|
49
|
+
return { type: id as SitemapType };
|
50
|
+
}
|
51
|
+
|
52
|
+
export default async function sitemap({ id }: { id: string }): Promise<MetadataRoute.Sitemap> {
|
53
|
+
const { type, page } = parsePaginatedId(id);
|
54
|
+
const sitemapModule = new Sitemap();
|
55
|
+
|
56
|
+
switch (type) {
|
12
57
|
case SitemapType.Pages: {
|
13
58
|
return sitemapModule.getPage();
|
14
59
|
}
|
15
60
|
case SitemapType.Assistants: {
|
16
|
-
return sitemapModule.getAssistants();
|
61
|
+
return sitemapModule.getAssistants(page);
|
62
|
+
}
|
63
|
+
case SitemapType.Mcp: {
|
64
|
+
return sitemapModule.getMcp(page);
|
17
65
|
}
|
18
66
|
case SitemapType.Plugins: {
|
19
|
-
return sitemapModule.getPlugins();
|
67
|
+
return sitemapModule.getPlugins(page);
|
20
68
|
}
|
21
69
|
case SitemapType.Models: {
|
22
|
-
return sitemapModule.getModels();
|
70
|
+
return sitemapModule.getModels(page);
|
23
71
|
}
|
24
72
|
case SitemapType.Providers: {
|
25
73
|
return sitemapModule.getProviders();
|
26
74
|
}
|
27
|
-
|
28
|
-
|
75
|
+
default: {
|
76
|
+
// 处理分页的sitemap(plugins-1, assistants-2, mcp-3等)
|
77
|
+
if (id.startsWith('plugins-')) {
|
78
|
+
const pageNum = parseInt(id.split('-')[1], 10);
|
79
|
+
return sitemapModule.getPlugins(pageNum);
|
80
|
+
}
|
81
|
+
if (id.startsWith('assistants-')) {
|
82
|
+
const pageNum = parseInt(id.split('-')[1], 10);
|
83
|
+
return sitemapModule.getAssistants(pageNum);
|
84
|
+
}
|
85
|
+
if (id.startsWith('mcp-')) {
|
86
|
+
const pageNum = parseInt(id.split('-')[1], 10);
|
87
|
+
return sitemapModule.getMcp(pageNum);
|
88
|
+
}
|
89
|
+
if (id.startsWith('models-')) {
|
90
|
+
const pageNum = parseInt(id.split('-')[1], 10);
|
91
|
+
return sitemapModule.getModels(pageNum);
|
92
|
+
}
|
29
93
|
|
30
|
-
|
94
|
+
// 默认返回空数组
|
95
|
+
return [];
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { CopyButton, Text } from '@lobehub/ui';
|
2
|
+
import { CSSProperties, memo } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
const CopyableLabel = memo<{ style?: CSSProperties; value?: string | null }>(
|
6
|
+
({ style, value = '--' }) => {
|
7
|
+
return (
|
8
|
+
<Flexbox
|
9
|
+
align={'center'}
|
10
|
+
gap={4}
|
11
|
+
horizontal
|
12
|
+
style={{
|
13
|
+
overflow: 'hidden',
|
14
|
+
position: 'relative',
|
15
|
+
...style,
|
16
|
+
}}
|
17
|
+
>
|
18
|
+
<Text
|
19
|
+
ellipsis
|
20
|
+
style={{
|
21
|
+
color: 'inherit',
|
22
|
+
fontFamily: 'inherit',
|
23
|
+
fontSize: 'inherit',
|
24
|
+
margin: 0,
|
25
|
+
overflow: 'hidden',
|
26
|
+
width: '100%',
|
27
|
+
}}
|
28
|
+
>
|
29
|
+
{value || '--'}
|
30
|
+
</Text>
|
31
|
+
<CopyButton content={value || '--'} size={'small'} />
|
32
|
+
</Flexbox>
|
33
|
+
);
|
34
|
+
},
|
35
|
+
);
|
36
|
+
|
37
|
+
export default CopyableLabel;
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import { Grid, type GridProps, Icon, IconProps, Text } from '@lobehub/ui';
|
2
|
+
import { createStyles } from 'antd-style';
|
3
|
+
import { CSSProperties, ReactNode, memo } from 'react';
|
4
|
+
import { Flexbox } from 'react-layout-kit';
|
5
|
+
|
6
|
+
import CopyableLabel from '../CopyableLabel';
|
7
|
+
|
8
|
+
const useStyles = createStyles(({ responsive, css, token }) => {
|
9
|
+
return {
|
10
|
+
bordered: css`
|
11
|
+
overflow: hidden;
|
12
|
+
border: 1px solid ${token.colorBorderSecondary};
|
13
|
+
border-radius: ${token.borderRadiusLG}px;
|
14
|
+
${responsive.mobile} {
|
15
|
+
background: ${token.colorBgContainer};
|
16
|
+
}
|
17
|
+
`,
|
18
|
+
cell: css`
|
19
|
+
overflow: hidden;
|
20
|
+
box-shadow: 0 0 0 0.5px ${token.colorBorderSecondary};
|
21
|
+
`,
|
22
|
+
label: css`
|
23
|
+
overflow: hidden;
|
24
|
+
border-inline-end: 1px solid ${token.colorBorderSecondary};
|
25
|
+
background: ${token.colorFillQuaternary};
|
26
|
+
`,
|
27
|
+
};
|
28
|
+
});
|
29
|
+
|
30
|
+
export interface DescriptionItem {
|
31
|
+
copyable?: boolean;
|
32
|
+
icon?: IconProps['icon'];
|
33
|
+
key: string;
|
34
|
+
label: ReactNode;
|
35
|
+
style?: CSSProperties;
|
36
|
+
value: ReactNode;
|
37
|
+
}
|
38
|
+
|
39
|
+
interface DescriptionsProps extends Omit<GridProps, 'children'> {
|
40
|
+
bordered?: boolean;
|
41
|
+
items: DescriptionItem[];
|
42
|
+
labelWidth?: number | string;
|
43
|
+
}
|
44
|
+
|
45
|
+
const Descriptions = memo<DescriptionsProps>(
|
46
|
+
({ labelWidth = 150, title, bordered, className, items, ...rest }) => {
|
47
|
+
const { cx, styles, theme } = useStyles();
|
48
|
+
|
49
|
+
return (
|
50
|
+
<>
|
51
|
+
{title && <h3 style={{ marginTop: 12 }}>{title}</h3>}
|
52
|
+
<Grid
|
53
|
+
className={cx(bordered && styles.bordered, className)}
|
54
|
+
gap={0}
|
55
|
+
maxItemWidth={450}
|
56
|
+
{...rest}
|
57
|
+
>
|
58
|
+
{items.map((item) => (
|
59
|
+
<Flexbox
|
60
|
+
align={'center'}
|
61
|
+
className={cx(bordered && styles.cell)}
|
62
|
+
flex={1}
|
63
|
+
horizontal
|
64
|
+
key={item.key}
|
65
|
+
style={{
|
66
|
+
overflow: 'hidden',
|
67
|
+
position: 'relative',
|
68
|
+
}}
|
69
|
+
>
|
70
|
+
<Flexbox
|
71
|
+
align={'center'}
|
72
|
+
className={cx(bordered && styles.label)}
|
73
|
+
flex={'none'}
|
74
|
+
gap={6}
|
75
|
+
horizontal
|
76
|
+
paddingBlock={bordered ? 12 : 4}
|
77
|
+
paddingInline={bordered ? 16 : 0}
|
78
|
+
style={{ height: '100%', position: 'relative' }}
|
79
|
+
width={labelWidth}
|
80
|
+
>
|
81
|
+
{item.icon && <Icon color={theme.colorTextSecondary} icon={item.icon} />}
|
82
|
+
<Text
|
83
|
+
ellipsis
|
84
|
+
style={{
|
85
|
+
color: theme.colorTextSecondary,
|
86
|
+
}}
|
87
|
+
>
|
88
|
+
{item.label}
|
89
|
+
</Text>
|
90
|
+
</Flexbox>
|
91
|
+
<Flexbox
|
92
|
+
align={'center'}
|
93
|
+
flex={1}
|
94
|
+
horizontal
|
95
|
+
justify={'flex-start'}
|
96
|
+
paddingBlock={bordered ? 12 : 4}
|
97
|
+
paddingInline={16}
|
98
|
+
style={{ height: '100%', overflow: 'hidden', position: 'relative' }}
|
99
|
+
>
|
100
|
+
{item.copyable ? (
|
101
|
+
<CopyableLabel
|
102
|
+
style={item.style}
|
103
|
+
value={item.value ? String(item.value) : '--'}
|
104
|
+
/>
|
105
|
+
) : (
|
106
|
+
<Text ellipsis style={{ ...item.style }}>
|
107
|
+
{item.value}
|
108
|
+
</Text>
|
109
|
+
)}
|
110
|
+
</Flexbox>
|
111
|
+
</Flexbox>
|
112
|
+
))}
|
113
|
+
</Grid>
|
114
|
+
</>
|
115
|
+
);
|
116
|
+
},
|
117
|
+
);
|
118
|
+
|
119
|
+
export default Descriptions;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { ConfigProvider, Table, TableProps } from 'antd';
|
2
|
+
import { createStyles } from 'antd-style';
|
3
|
+
import { memo } from 'react';
|
4
|
+
|
5
|
+
const useStyles = createStyles(({ css, prefixCls }) => ({
|
6
|
+
hoverToActive: css`
|
7
|
+
opacity: 0.6;
|
8
|
+
|
9
|
+
&:hover {
|
10
|
+
opacity: 1;
|
11
|
+
}
|
12
|
+
`,
|
13
|
+
table: css`
|
14
|
+
.${prefixCls}-table {
|
15
|
+
background: transparent;
|
16
|
+
|
17
|
+
th,
|
18
|
+
td {
|
19
|
+
border: none !important;
|
20
|
+
font-size: 13px;
|
21
|
+
}
|
22
|
+
|
23
|
+
.${prefixCls}-table-cell:before {
|
24
|
+
display: none;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
tr {
|
29
|
+
td:first-child,
|
30
|
+
th:first-child {
|
31
|
+
padding-inline-start: 24px !important;
|
32
|
+
}
|
33
|
+
|
34
|
+
td:last-child,
|
35
|
+
th:last-child {
|
36
|
+
padding-inline-end: 24px !important;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
`,
|
40
|
+
}));
|
41
|
+
|
42
|
+
const InlineTable = memo<TableProps & { hoverToActive?: boolean }>(
|
43
|
+
({ hoverToActive, className, ...rest }) => {
|
44
|
+
const { cx, styles, theme } = useStyles();
|
45
|
+
return (
|
46
|
+
<ConfigProvider
|
47
|
+
theme={{
|
48
|
+
components: {
|
49
|
+
Table: {
|
50
|
+
headerBg: theme.colorFillQuaternary,
|
51
|
+
headerBorderRadius: 0,
|
52
|
+
},
|
53
|
+
},
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
<Table
|
57
|
+
bordered={false}
|
58
|
+
className={cx(styles.table, hoverToActive && styles.hoverToActive, className)}
|
59
|
+
pagination={false}
|
60
|
+
scroll={{ x: 'max-content' }}
|
61
|
+
size={'small'}
|
62
|
+
{...rest}
|
63
|
+
/>
|
64
|
+
</ConfigProvider>
|
65
|
+
);
|
66
|
+
},
|
67
|
+
);
|
68
|
+
|
69
|
+
export default InlineTable;
|
@@ -3,7 +3,7 @@ import { Slider, Switch } from 'antd';
|
|
3
3
|
import { JSONSchema7Type } from 'json-schema';
|
4
4
|
import { memo } from 'react';
|
5
5
|
|
6
|
-
interface
|
6
|
+
interface JSONSchemaItemRenderProps {
|
7
7
|
defaultValue?: any;
|
8
8
|
enum?: JSONSchema7Type[];
|
9
9
|
format?: string;
|
@@ -15,7 +15,7 @@ interface PluginSettingsProps {
|
|
15
15
|
value?: any;
|
16
16
|
}
|
17
17
|
|
18
|
-
const
|
18
|
+
const JSONSchemaItemRender = memo<JSONSchemaItemRenderProps>(
|
19
19
|
({ type, enum: enumItems, format, minimum, maximum, ...props }) => {
|
20
20
|
switch (type) {
|
21
21
|
case 'string': {
|
@@ -51,4 +51,4 @@ const PluginSettingRender = memo<PluginSettingsProps>(
|
|
51
51
|
},
|
52
52
|
);
|
53
53
|
|
54
|
-
export default
|
54
|
+
export default JSONSchemaItemRender;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import type { IconType } from '@lobehub/icons';
|
4
|
+
import { memo } from 'react';
|
5
|
+
|
6
|
+
const Icon: IconType = memo(({ size = '1em', style, ...rest }) => {
|
7
|
+
return (
|
8
|
+
<svg
|
9
|
+
fill="currentColor"
|
10
|
+
fillRule="evenodd"
|
11
|
+
height={size}
|
12
|
+
style={{ flex: 'none', lineHeight: 1, ...style }}
|
13
|
+
viewBox="0 0 50 50"
|
14
|
+
width={size}
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
16
|
+
{...rest}
|
17
|
+
>
|
18
|
+
<path d="M28.188 0c2.75 6.363-9.86 10.293-11.032 15.594-1.074 4.87 7.492 10.531 7.5 10.531-1.3-2.016-2.258-3.676-3.562-6.813C18.887 14.008 34.535 9.207 28.187 0zm8.375 8.813s-11.063.71-11.626 7.78c-.25 3.15 2.91 4.805 3 7.095.075 1.87-1.875 3.437-1.875 3.437s3.547-.676 4.657-3.531c1.23-3.168-2.399-5.309-2.032-7.844.352-2.426 7.875-6.938 7.875-6.938zM19.186 25.155s-10.125-.144-10.125 2.719c0 2.992 13.254 3.215 22.72 1.375 0 0 2.515-1.73 3.187-2.375-6.203 1.266-20.344 1.406-20.344.313 0-1.008 4.563-2.032 4.563-2.032zm19.47 0c-.993.078-2.063.461-3.032 1.157 2.281-.493 4.219.921 4.219 2.53 0 3.626-5.25 7.032-5.25 7.032s8.125-.922 8.125-6.875c0-2.703-1.88-4.016-4.063-3.844zM16.75 30.72c-1.555 0-3.875 1.218-3.875 2.375 0 2.324 11.688 4.113 20.344.718l-3-1.843c-5.867 1.879-16.672 1.265-13.469-1.25zm1.438 5.218c-2.13 0-3.532 1.286-3.532 2.25 0 2.985 12.715 3.286 17.75.25l-3.187-2.03c-3.762 1.59-13.203 1.831-11.032-.47zm-7.094 2.688c-3.469-.07-5.719 1.488-5.719 2.781 0 6.875 35.5 6.559 35.5-.468 0-1.168-1.348-1.735-1.844-2C41.934 45.656 9.97 45.12 9.97 41.156c0-.902 2.351-1.765 4.531-1.343l-1.844-1.063a12.349 12.349 0 00-1.562-.125zm33.531 4.625c-5.398 5.117-19.078 6.973-32.844 3.813 13.762 5.632 32.778 2.472 32.844-3.813z" />
|
19
|
+
</svg>
|
20
|
+
);
|
21
|
+
});
|
22
|
+
|
23
|
+
export default Icon;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import type { IconType } from '@lobehub/icons';
|
4
|
+
import { memo } from 'react';
|
5
|
+
|
6
|
+
const Icon: IconType = memo(({ size = '1em', style, ...rest }) => {
|
7
|
+
return (
|
8
|
+
<svg
|
9
|
+
fill="currentColor"
|
10
|
+
fillRule="evenodd"
|
11
|
+
height={size}
|
12
|
+
style={{ flex: 'none', lineHeight: 1, ...style }}
|
13
|
+
viewBox="0 0 50 50"
|
14
|
+
width={size}
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
16
|
+
{...rest}
|
17
|
+
>
|
18
|
+
<path d="M49.324 7.34c-.94-1.17-2.61-1.32-3.96-1.33-3.929-.01-28.786-.01-32.386 0-3.999.01-5.579 1.27-6.479 5.17C4.409 20.19 2.33 29.21.27 38.23c-.31 1.37-.55 3.11.42 4.33.99 1.24 2.79 1.41 4.249 1.41 5.159.02 26.657.02 32.376 0 3.55-.01 5.469-1.51 6.239-4.88 2.28-9.98 4.309-19.02 6.199-27.64.291-1.3.501-2.95-.429-4.11zM14.758 38.28c-1.2.88-2.34 1.11-3.3-.2-1.07-1.45-.08-2.31 1.02-3.12 3.96-2.89 7.909-5.8 11.839-8.72.55-.41 1.27-.97 1.74-1.32-.61-.69-1.12-1.26-1.53-1.73-2.43-2.73-4.659-5.27-7.069-7.87-1.1-1.19-1.45-2.34-.13-3.52 1.31-1.16 2.6-1.06 3.789.28 3.34 3.72 6.679 7.44 10.069 11.1 1.27 1.37.98 2.3-.42 3.32-5.359 3.89-10.689 7.83-16.008 11.78zM32.246 38h-9.499c-1.13 0-1.75-1-1.75-2s.62-2 1.75-2h9.499c1.13 0 1.75 1 1.75 2s-.62 2-1.75 2z" />
|
19
|
+
</svg>
|
20
|
+
);
|
21
|
+
});
|
22
|
+
|
23
|
+
export default Icon;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import type { IconType } from '@lobehub/icons';
|
4
|
+
import { memo } from 'react';
|
5
|
+
|
6
|
+
const Icon: IconType = memo(({ size = '1em', style, ...rest }) => {
|
7
|
+
return (
|
8
|
+
<svg
|
9
|
+
fill="currentColor"
|
10
|
+
fillRule="evenodd"
|
11
|
+
height={size}
|
12
|
+
style={{ flex: 'none', lineHeight: 1, ...style }}
|
13
|
+
viewBox="0 0 24 24"
|
14
|
+
width={size}
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
16
|
+
{...rest}
|
17
|
+
>
|
18
|
+
<path d="M7.293 14.293a1 1 0 101.414 1.414l2.5-2.5a1.707 1.707 0 000-2.414l-2.5-2.5a1 1 0 00-1.414 1.414L9.586 12l-2.293 2.293zM13 14a1 1 0 100 2h3a1 1 0 100-2h-3zm9-6.066V16.066c0 .886 0 1.65-.082 2.262-.088.655-.287 1.284-.797 1.793-.51.51-1.138.709-1.793.797-.612.082-1.376.082-2.262.082H6.934c-.886 0-1.65 0-2.262-.082-.655-.088-1.284-.287-1.793-.797-.51-.51-.709-1.138-.797-1.793C2 17.716 2 16.952 2 16.066V7.934c0-.886 0-1.65.082-2.262.088-.655.287-1.284.797-1.793.51-.51 1.138-.709 1.793-.797C5.284 3 6.048 3 6.934 3H17.066c.886 0 1.65 0 2.262.082.655.088 1.284.287 1.793.797.51.51.709 1.138.797 1.793C22 6.284 22 7.048 22 7.934z" />
|
19
|
+
</svg>
|
20
|
+
);
|
21
|
+
});
|
22
|
+
|
23
|
+
export default Icon;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import type { IconType } from '@lobehub/icons';
|
4
|
+
import { memo } from 'react';
|
5
|
+
|
6
|
+
const Icon: IconType = memo(({ size = '1em', style, ...rest }) => {
|
7
|
+
return (
|
8
|
+
<svg
|
9
|
+
fill="currentColor"
|
10
|
+
fillRule="evenodd"
|
11
|
+
height={size}
|
12
|
+
style={{ flex: 'none', lineHeight: 1, ...style }}
|
13
|
+
viewBox="0 0 41 41"
|
14
|
+
width={size}
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
16
|
+
{...rest}
|
17
|
+
>
|
18
|
+
<path d="M0 .169l.084 20 .068 16a4 4 0 004.017 3.982l16-.067 10-.042 1.016-.005c2.203-.009 3.983-1.834 3.983-4.037H37v4h3.168L40 0 21.6.078l.077 15.94V26H18.4l.077-9.968L18.4.092 0 .168z" />
|
19
|
+
</svg>
|
20
|
+
);
|
21
|
+
});
|
22
|
+
|
23
|
+
export default Icon;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import {
|
4
|
+
SiApachemaven,
|
5
|
+
SiBlender,
|
6
|
+
SiBun,
|
7
|
+
SiDeno,
|
8
|
+
SiDocker,
|
9
|
+
SiGit,
|
10
|
+
SiGo,
|
11
|
+
SiHelm,
|
12
|
+
SiKubernetes,
|
13
|
+
SiNodedotjs,
|
14
|
+
SiNpm,
|
15
|
+
SiPipx,
|
16
|
+
SiPnpm,
|
17
|
+
SiPython,
|
18
|
+
SiRust,
|
19
|
+
SiYarn,
|
20
|
+
} from '@icons-pack/react-simple-icons';
|
21
|
+
import { Icon, Tooltip } from '@lobehub/ui';
|
22
|
+
import { useTheme } from 'antd-style';
|
23
|
+
import { memo } from 'react';
|
24
|
+
|
25
|
+
import Java from './Java';
|
26
|
+
import PowerShell from './PowerShell';
|
27
|
+
import Terminal from './Terminal';
|
28
|
+
import UV from './UV';
|
29
|
+
|
30
|
+
const icons: any = {
|
31
|
+
blender: SiBlender,
|
32
|
+
bun: SiBun,
|
33
|
+
bunx: SiBun,
|
34
|
+
deno: SiDeno,
|
35
|
+
docker: SiDocker,
|
36
|
+
git: SiGit,
|
37
|
+
go: SiGo,
|
38
|
+
helm: SiHelm,
|
39
|
+
java: Java,
|
40
|
+
kubectl: SiKubernetes,
|
41
|
+
make: Terminal,
|
42
|
+
manual: Terminal,
|
43
|
+
maven: SiApachemaven,
|
44
|
+
nodejs: SiNodedotjs,
|
45
|
+
npm: SiNpm,
|
46
|
+
npx: SiNpm,
|
47
|
+
odbc: Terminal,
|
48
|
+
pandoc: Terminal,
|
49
|
+
pipx: SiPipx,
|
50
|
+
pnpm: SiPnpm,
|
51
|
+
pnpx: SiPnpm,
|
52
|
+
powershell: PowerShell,
|
53
|
+
python: SiPython,
|
54
|
+
rust: SiRust,
|
55
|
+
sh: Terminal,
|
56
|
+
uv: UV,
|
57
|
+
uvx: UV,
|
58
|
+
yarn: SiYarn,
|
59
|
+
};
|
60
|
+
|
61
|
+
const InstallationIcon = memo<{ size?: number; type: string }>(({ type, size = 20 }) => {
|
62
|
+
const theme = useTheme();
|
63
|
+
const iconType = type.split(' ')[0];
|
64
|
+
if (iconType === 'none') return;
|
65
|
+
return (
|
66
|
+
<Tooltip title={iconType}>
|
67
|
+
<Icon fill={theme.colorTextDescription} icon={icons?.[iconType] || Terminal} size={size} />
|
68
|
+
</Tooltip>
|
69
|
+
);
|
70
|
+
});
|
71
|
+
|
72
|
+
export default InstallationIcon;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import {
|
2
|
+
SiBun,
|
3
|
+
SiDocker,
|
4
|
+
SiNodedotjs,
|
5
|
+
SiNpm,
|
6
|
+
SiPnpm,
|
7
|
+
SiPython,
|
8
|
+
} from '@icons-pack/react-simple-icons';
|
9
|
+
import { AutoComplete, type AutoCompleteProps } from '@lobehub/ui';
|
10
|
+
import { FC, memo } from 'react';
|
11
|
+
import { Flexbox } from 'react-layout-kit';
|
12
|
+
|
13
|
+
// 定义预设的命令选项
|
14
|
+
const STDIO_COMMAND_OPTIONS: {
|
15
|
+
// 假设图标是 React 函数组件
|
16
|
+
color?: string;
|
17
|
+
icon?: FC<{ color?: string; size?: number }>;
|
18
|
+
value: string;
|
19
|
+
}[] = [
|
20
|
+
{ color: '#CB3837', icon: SiNpm, value: 'npx' },
|
21
|
+
{ color: '#CB3837', icon: SiNpm, value: 'npm' },
|
22
|
+
{ color: '#F69220', icon: SiPnpm, value: 'pnpm' },
|
23
|
+
{ color: '#F69220', icon: SiPnpm, value: 'pnpx' },
|
24
|
+
{ color: '#339933', icon: SiNodedotjs, value: 'node' },
|
25
|
+
{ color: '#efe2d2', icon: SiBun, value: 'bun' },
|
26
|
+
{ color: '#efe2d2', icon: SiBun, value: 'bunx' },
|
27
|
+
{ color: '#DE5FE9', icon: SiPython, value: 'uv' },
|
28
|
+
{ color: '#3776AB', icon: SiPython, value: 'python' },
|
29
|
+
{ color: '#2496ED', icon: SiDocker, value: 'docker' },
|
30
|
+
];
|
31
|
+
|
32
|
+
const MCPStdioCommandInput = memo<AutoCompleteProps>((props) => (
|
33
|
+
<AutoComplete
|
34
|
+
options={STDIO_COMMAND_OPTIONS.map(({ value, icon: Icon, color }) => ({
|
35
|
+
label: (
|
36
|
+
<Flexbox align={'center'} gap={8} horizontal>
|
37
|
+
{Icon && <Icon color={color} size={16} />}
|
38
|
+
{value}
|
39
|
+
</Flexbox>
|
40
|
+
),
|
41
|
+
value: value,
|
42
|
+
}))}
|
43
|
+
{...props}
|
44
|
+
/>
|
45
|
+
));
|
46
|
+
|
47
|
+
export default MCPStdioCommandInput;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import type { IconType } from '@lobehub/icons';
|
4
|
+
import { memo } from 'react';
|
5
|
+
|
6
|
+
const OfficialIcon: IconType = memo(({ size = 18, style, fill = '#1d9bf0', ...rest }) => {
|
7
|
+
return (
|
8
|
+
<svg
|
9
|
+
fill={fill}
|
10
|
+
fillRule="evenodd"
|
11
|
+
height={size}
|
12
|
+
style={{ flex: 'none', lineHeight: 1, ...style }}
|
13
|
+
viewBox="0 0 22 22"
|
14
|
+
width={size}
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
16
|
+
{...rest}
|
17
|
+
>
|
18
|
+
<path d="M20.396 11a3.487 3.487 0 00-2.008-3.062 3.474 3.474 0 00-.742-3.584 3.474 3.474 0 00-3.584-.742A3.468 3.468 0 0011 1.604a3.463 3.463 0 00-3.053 2.008 3.472 3.472 0 00-1.902-.14c-.635.13-1.22.436-1.69.882a3.461 3.461 0 00-.734 3.584A3.49 3.49 0 001.604 11a3.496 3.496 0 002.017 3.062 3.471 3.471 0 00.733 3.584 3.49 3.49 0 003.584.742A3.487 3.487 0 0011 20.396a3.476 3.476 0 003.062-2.007 3.335 3.335 0 004.326-4.327A3.487 3.487 0 0020.396 11zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z" />
|
19
|
+
</svg>
|
20
|
+
);
|
21
|
+
});
|
22
|
+
|
23
|
+
export default OfficialIcon;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { MCP } from '@lobehub/icons';
|
2
|
+
import { Tag } from '@lobehub/ui';
|
3
|
+
import { memo } from 'react';
|
4
|
+
|
5
|
+
interface MCPTagProps {
|
6
|
+
showIcon?: boolean;
|
7
|
+
showText?: boolean;
|
8
|
+
}
|
9
|
+
|
10
|
+
const MCPTag = memo<MCPTagProps>(({ showIcon = true, showText = true }) => {
|
11
|
+
return (
|
12
|
+
<Tag icon={showIcon && <MCP />} size={'small'}>
|
13
|
+
{showText && 'Model Context Protocol'}
|
14
|
+
</Tag>
|
15
|
+
);
|
16
|
+
});
|
17
|
+
|
18
|
+
export default MCPTag;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { Icon, Tag } from '@lobehub/ui';
|
2
|
+
import { BadgeCheck, CircleUser, Package } from 'lucide-react';
|
3
|
+
import { memo } from 'react';
|
4
|
+
import { useTranslation } from 'react-i18next';
|
5
|
+
|
6
|
+
import MCPTag from './MCPTag';
|
7
|
+
|
8
|
+
interface PluginTagProps {
|
9
|
+
author?: string;
|
10
|
+
isMCP?: boolean;
|
11
|
+
showIcon?: boolean;
|
12
|
+
showText?: boolean;
|
13
|
+
type: 'builtin' | 'customPlugin' | 'plugin';
|
14
|
+
}
|
15
|
+
|
16
|
+
const PluginTag = memo<PluginTagProps>(
|
17
|
+
({ showIcon = true, author, type, showText = true, isMCP }) => {
|
18
|
+
const { t } = useTranslation('plugin');
|
19
|
+
const isCustom = type === 'customPlugin';
|
20
|
+
const isOfficial = author === 'LobeHub';
|
21
|
+
|
22
|
+
const customTag = (
|
23
|
+
<Tag color={'warning'} icon={showIcon && <Icon icon={Package} />} size={'small'}>
|
24
|
+
{t('store.customPlugin')}
|
25
|
+
</Tag>
|
26
|
+
);
|
27
|
+
|
28
|
+
if (isMCP)
|
29
|
+
return (
|
30
|
+
<>
|
31
|
+
<MCPTag showIcon={showIcon} showText={false} />
|
32
|
+
{isCustom && customTag}
|
33
|
+
</>
|
34
|
+
);
|
35
|
+
|
36
|
+
if (isCustom) return customTag;
|
37
|
+
|
38
|
+
return (
|
39
|
+
<Tag
|
40
|
+
color={isOfficial ? 'success' : undefined}
|
41
|
+
icon={showIcon && <Icon icon={isOfficial ? BadgeCheck : CircleUser} />}
|
42
|
+
size={'small'}
|
43
|
+
>
|
44
|
+
{showText && (author || t('store.communityPlugin'))}
|
45
|
+
</Tag>
|
46
|
+
);
|
47
|
+
},
|
48
|
+
);
|
49
|
+
|
50
|
+
export default PluginTag;
|