@lobehub/chat 1.96.19 → 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/.env.example +7 -0
- package/CHANGELOG.md +50 -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 +18 -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 +265 -13
- 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
@@ -0,0 +1,71 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { createStyles } from 'antd-style';
|
4
|
+
import dayjs from 'dayjs';
|
5
|
+
import 'dayjs/locale/zh.js';
|
6
|
+
import { CSSProperties, FC } from 'react';
|
7
|
+
import { useTranslation } from 'react-i18next';
|
8
|
+
|
9
|
+
const LAST_MODIFIED = new Date().toISOString();
|
10
|
+
|
11
|
+
const formatTime = (time?: string) => {
|
12
|
+
try {
|
13
|
+
if (!time) return LAST_MODIFIED;
|
14
|
+
return dayjs(time).toISOString();
|
15
|
+
} catch {
|
16
|
+
return LAST_MODIFIED;
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
const useStyles = createStyles(({ css, token }) => {
|
21
|
+
return {
|
22
|
+
time: css`
|
23
|
+
font-size: 12px;
|
24
|
+
color: ${token.colorTextSecondary};
|
25
|
+
letter-spacing: 0.02em;
|
26
|
+
`,
|
27
|
+
};
|
28
|
+
});
|
29
|
+
|
30
|
+
interface PrivacyUpdatedProps {
|
31
|
+
className?: string;
|
32
|
+
date: string;
|
33
|
+
showPrefix?: boolean;
|
34
|
+
style?: CSSProperties;
|
35
|
+
template?: string;
|
36
|
+
}
|
37
|
+
const PublishedTime: FC<PrivacyUpdatedProps> = ({
|
38
|
+
date,
|
39
|
+
style,
|
40
|
+
className,
|
41
|
+
template = 'dddd, MMMM D YYYY',
|
42
|
+
showPrefix = true,
|
43
|
+
}) => {
|
44
|
+
const { t, i18n } = useTranslation('discover');
|
45
|
+
const { styles, cx } = useStyles();
|
46
|
+
const time = dayjs(date).locale(i18n.language).format(template);
|
47
|
+
|
48
|
+
if (showPrefix) {
|
49
|
+
return (
|
50
|
+
<div className={cx(styles.time, className)} style={style}>
|
51
|
+
{t('publishedTime')}{' '}
|
52
|
+
<time aria-label={'published-date'} dateTime={formatTime(date)}>
|
53
|
+
{time}
|
54
|
+
</time>
|
55
|
+
</div>
|
56
|
+
);
|
57
|
+
} else {
|
58
|
+
return (
|
59
|
+
<time
|
60
|
+
aria-label={'published-date'}
|
61
|
+
className={cx(styles.time, className)}
|
62
|
+
dateTime={formatTime(date)}
|
63
|
+
style={style}
|
64
|
+
>
|
65
|
+
{time}
|
66
|
+
</time>
|
67
|
+
);
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
export default PublishedTime;
|
@@ -27,7 +27,9 @@ describe('getServerConfig', () => {
|
|
27
27
|
expect(config.AGENTS_INDEX_URL).toBe(
|
28
28
|
'https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public',
|
29
29
|
);
|
30
|
-
expect(config.PLUGINS_INDEX_URL).toBe(
|
30
|
+
expect(config.PLUGINS_INDEX_URL).toBe(
|
31
|
+
'https://registry.npmmirror.com/@lobehub/plugins-index/v1/files/public',
|
32
|
+
);
|
31
33
|
});
|
32
34
|
|
33
35
|
it('should return custom URLs when environment variables are set', () => {
|
@@ -46,7 +48,9 @@ describe('getServerConfig', () => {
|
|
46
48
|
expect(config.AGENTS_INDEX_URL).toBe(
|
47
49
|
'https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public',
|
48
50
|
);
|
49
|
-
expect(config.PLUGINS_INDEX_URL).toBe(
|
51
|
+
expect(config.PLUGINS_INDEX_URL).toBe(
|
52
|
+
'https://registry.npmmirror.com/@lobehub/plugins-index/v1/files/public',
|
53
|
+
);
|
50
54
|
});
|
51
55
|
});
|
52
56
|
});
|
package/src/const/discover.ts
CHANGED
@@ -1,61 +1,35 @@
|
|
1
1
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
2
2
|
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
DiscoverAssistantDetail,
|
4
|
+
DiscoverModelDetail,
|
5
|
+
DiscoverPluginDetail,
|
6
|
+
DiscoverProviderDetail,
|
7
7
|
} from '@/types/discover';
|
8
8
|
|
9
9
|
const DEFAULT_CREATED_AT = new Date().toISOString();
|
10
10
|
|
11
|
-
export const DEFAULT_DISCOVER_ASSISTANT_ITEM: Partial<
|
11
|
+
export const DEFAULT_DISCOVER_ASSISTANT_ITEM: Partial<DiscoverAssistantDetail> = {
|
12
12
|
author: '',
|
13
13
|
config: DEFAULT_AGENT_CONFIG,
|
14
14
|
createdAt: DEFAULT_CREATED_AT,
|
15
15
|
homepage: '',
|
16
16
|
identifier: '',
|
17
|
-
schemaVersion: 1,
|
18
|
-
socialData: {
|
19
|
-
conversations: 0,
|
20
|
-
likes: 0,
|
21
|
-
users: 0,
|
22
|
-
},
|
23
17
|
};
|
24
18
|
|
25
|
-
export const DEFAULT_DISCOVER_PLUGIN_ITEM: Partial<
|
19
|
+
export const DEFAULT_DISCOVER_PLUGIN_ITEM: Partial<DiscoverPluginDetail> = {
|
26
20
|
author: '',
|
27
21
|
createdAt: DEFAULT_CREATED_AT,
|
28
22
|
homepage: '',
|
29
23
|
identifier: '',
|
30
24
|
schemaVersion: 1,
|
31
|
-
socialData: {
|
32
|
-
called: 0,
|
33
|
-
executionTime: 0,
|
34
|
-
likes: 0,
|
35
|
-
relatedAssistants: 0,
|
36
|
-
successRate: 1,
|
37
|
-
users: 0,
|
38
|
-
},
|
39
25
|
};
|
40
26
|
|
41
|
-
export const DEFAULT_DISCOVER_MODEL_ITEM: Partial<
|
42
|
-
createdAt: DEFAULT_CREATED_AT,
|
27
|
+
export const DEFAULT_DISCOVER_MODEL_ITEM: Partial<DiscoverModelDetail> = {
|
43
28
|
identifier: '',
|
44
29
|
providers: [],
|
45
|
-
socialData: {
|
46
|
-
conversations: 0,
|
47
|
-
likes: 0,
|
48
|
-
tokens: 0,
|
49
|
-
},
|
50
30
|
};
|
51
31
|
|
52
|
-
export const DEFAULT_DISCOVER_PROVIDER_ITEM: Partial<
|
53
|
-
createdAt: DEFAULT_CREATED_AT,
|
32
|
+
export const DEFAULT_DISCOVER_PROVIDER_ITEM: Partial<DiscoverProviderDetail> = {
|
54
33
|
identifier: '',
|
55
34
|
models: [],
|
56
|
-
socialData: {
|
57
|
-
conversations: 0,
|
58
|
-
likes: 0,
|
59
|
-
users: 0,
|
60
|
-
},
|
61
35
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { and, desc, eq } from 'drizzle-orm/expressions';
|
2
2
|
|
3
3
|
import { LobeChatDatabase } from '@/database/type';
|
4
|
+
import { LobeTool } from '@/types/tool';
|
4
5
|
|
5
6
|
import { InstalledPluginItem, NewInstalledPlugin, userInstalledPlugins } from '../schemas';
|
6
7
|
|
@@ -14,11 +15,14 @@ export class PluginModel {
|
|
14
15
|
}
|
15
16
|
|
16
17
|
create = async (
|
17
|
-
params: Pick<
|
18
|
+
params: Pick<
|
19
|
+
NewInstalledPlugin,
|
20
|
+
'type' | 'identifier' | 'manifest' | 'customParams' | 'settings'
|
21
|
+
>,
|
18
22
|
) => {
|
19
23
|
const [result] = await this.db
|
20
24
|
.insert(userInstalledPlugins)
|
21
|
-
.values({ ...params,
|
25
|
+
.values({ ...params, userId: this.userId })
|
22
26
|
.onConflictDoUpdate({
|
23
27
|
set: { ...params, updatedAt: new Date() },
|
24
28
|
target: [userInstalledPlugins.identifier, userInstalledPlugins.userId],
|
@@ -41,19 +45,25 @@ export class PluginModel {
|
|
41
45
|
};
|
42
46
|
|
43
47
|
query = async () => {
|
44
|
-
|
48
|
+
const data = await this.db
|
45
49
|
.select({
|
46
50
|
createdAt: userInstalledPlugins.createdAt,
|
47
51
|
customParams: userInstalledPlugins.customParams,
|
48
52
|
identifier: userInstalledPlugins.identifier,
|
49
53
|
manifest: userInstalledPlugins.manifest,
|
50
54
|
settings: userInstalledPlugins.settings,
|
55
|
+
source: userInstalledPlugins.type,
|
51
56
|
type: userInstalledPlugins.type,
|
52
57
|
updatedAt: userInstalledPlugins.updatedAt,
|
53
58
|
})
|
54
59
|
.from(userInstalledPlugins)
|
55
60
|
.where(eq(userInstalledPlugins.userId, this.userId))
|
56
61
|
.orderBy(desc(userInstalledPlugins.createdAt));
|
62
|
+
|
63
|
+
return data.map<LobeTool>((item) => ({
|
64
|
+
...item,
|
65
|
+
runtimeType: item.manifest?.type || 'default',
|
66
|
+
}));
|
57
67
|
};
|
58
68
|
|
59
69
|
findById = async (id: string) => {
|
package/src/envs/app.ts
CHANGED
@@ -25,7 +25,7 @@ if (typeof window === 'undefined' && isServerMode && !APP_URL) {
|
|
25
25
|
|
26
26
|
const ASSISTANT_INDEX_URL = 'https://registry.npmmirror.com/@lobehub/agents-index/v1/files/public';
|
27
27
|
|
28
|
-
const PLUGINS_INDEX_URL = 'https://
|
28
|
+
const PLUGINS_INDEX_URL = 'https://registry.npmmirror.com/@lobehub/plugins-index/v1/files/public';
|
29
29
|
|
30
30
|
export const getAppConfig = () => {
|
31
31
|
const ACCESS_CODES = process.env.ACCESS_CODE?.split(',').filter(Boolean) || [];
|
@@ -9,10 +9,10 @@ import { memo, useState } from 'react';
|
|
9
9
|
import { Trans, useTranslation } from 'react-i18next';
|
10
10
|
import { Center, Flexbox } from 'react-layout-kit';
|
11
11
|
|
12
|
+
import PluginAvatar from '@/components/Plugins/PluginAvatar';
|
13
|
+
import PluginTag from '@/components/Plugins/PluginTag';
|
12
14
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
13
15
|
import PluginStore from '@/features/PluginStore';
|
14
|
-
import PluginAvatar from '@/features/PluginStore/PluginItem/PluginAvatar';
|
15
|
-
import PluginTag from '@/features/PluginStore/PluginItem/PluginTag';
|
16
16
|
import { useFetchInstalledPlugins } from '@/hooks/useFetchInstalledPlugins';
|
17
17
|
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
18
18
|
import { pluginHelpers, useToolStore } from '@/store/tool';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { memo } from 'react';
|
2
2
|
import { Flexbox } from 'react-layout-kit';
|
3
3
|
|
4
|
-
import PluginTag from '@/
|
4
|
+
import PluginTag from '@/components/Plugins/PluginTag';
|
5
5
|
import { useToolStore } from '@/store/tool';
|
6
6
|
import { customPluginSelectors } from '@/store/tool/selectors';
|
7
7
|
|
@@ -4,13 +4,13 @@ import { ArrowRight, Store, ToyBrick } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
6
6
|
|
7
|
-
import PluginAvatar from '@/
|
7
|
+
import PluginAvatar from '@/components/Plugins/PluginAvatar';
|
8
8
|
import { useCheckPluginsIsInstalled } from '@/hooks/useCheckPluginsIsInstalled';
|
9
9
|
import { useFetchInstalledPlugins } from '@/hooks/useFetchInstalledPlugins';
|
10
10
|
import { useAgentStore } from '@/store/agent';
|
11
11
|
import { agentSelectors } from '@/store/agent/selectors';
|
12
12
|
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
13
|
-
import {
|
13
|
+
import { useToolStore } from '@/store/tool';
|
14
14
|
import { builtinToolSelectors, pluginSelectors } from '@/store/tool/selectors';
|
15
15
|
|
16
16
|
import ToolItem from './ToolItem';
|
@@ -69,8 +69,8 @@ export const useControls = ({
|
|
69
69
|
},
|
70
70
|
{
|
71
71
|
children: list.map((item) => ({
|
72
|
-
icon: item
|
73
|
-
<PluginAvatar avatar={
|
72
|
+
icon: item?.avatar ? (
|
73
|
+
<PluginAvatar avatar={item.avatar} size={20} />
|
74
74
|
) : (
|
75
75
|
<Icon icon={ToyBrick} size={20} />
|
76
76
|
),
|
@@ -79,7 +79,7 @@ export const useControls = ({
|
|
79
79
|
<ToolItem
|
80
80
|
checked={checked.includes(item.identifier)}
|
81
81
|
id={item.identifier}
|
82
|
-
label={
|
82
|
+
label={item.title}
|
83
83
|
onUpdate={async () => {
|
84
84
|
setUpdating(true);
|
85
85
|
await togglePlugin(item.identifier);
|
@@ -18,7 +18,14 @@ import Debug from './Debug';
|
|
18
18
|
import Settings from './Settings';
|
19
19
|
import ToolTitle from './ToolTitle';
|
20
20
|
|
21
|
-
export const useStyles = createStyles(({ css, token }) => ({
|
21
|
+
export const useStyles = createStyles(({ css, token, cx }) => ({
|
22
|
+
actions: cx(
|
23
|
+
'inspector-container',
|
24
|
+
css`
|
25
|
+
opacity: 0;
|
26
|
+
transition: opacity 300ms ease-in-out;
|
27
|
+
`,
|
28
|
+
),
|
22
29
|
apiName: css`
|
23
30
|
overflow: hidden;
|
24
31
|
display: -webkit-box;
|
@@ -30,6 +37,20 @@ export const useStyles = createStyles(({ css, token }) => ({
|
|
30
37
|
text-overflow: ellipsis;
|
31
38
|
`,
|
32
39
|
container: css`
|
40
|
+
:hover {
|
41
|
+
.inspector-container {
|
42
|
+
opacity: 1;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
`,
|
46
|
+
plugin: css`
|
47
|
+
display: flex;
|
48
|
+
gap: 4px;
|
49
|
+
align-items: center;
|
50
|
+
width: fit-content;
|
51
|
+
`,
|
52
|
+
shinyText: shinyTextStylish(token),
|
53
|
+
tool: css`
|
33
54
|
cursor: pointer;
|
34
55
|
|
35
56
|
width: fit-content;
|
@@ -42,13 +63,6 @@ export const useStyles = createStyles(({ css, token }) => ({
|
|
42
63
|
background: ${token.colorFillTertiary};
|
43
64
|
}
|
44
65
|
`,
|
45
|
-
plugin: css`
|
46
|
-
display: flex;
|
47
|
-
gap: 4px;
|
48
|
-
align-items: center;
|
49
|
-
width: fit-content;
|
50
|
-
`,
|
51
|
-
shinyText: shinyTextStylish(token),
|
52
66
|
}));
|
53
67
|
|
54
68
|
interface InspectorProps {
|
@@ -87,11 +101,11 @@ const Inspectors = memo<InspectorProps>(
|
|
87
101
|
const [showDebug, setShowDebug] = useState(false);
|
88
102
|
|
89
103
|
return (
|
90
|
-
<Flexbox gap={4}>
|
104
|
+
<Flexbox className={styles.container} gap={4}>
|
91
105
|
<Flexbox align={'center'} distribution={'space-between'} gap={8} horizontal>
|
92
106
|
<Flexbox
|
93
107
|
align={'center'}
|
94
|
-
className={styles.
|
108
|
+
className={styles.tool}
|
95
109
|
gap={8}
|
96
110
|
horizontal
|
97
111
|
onClick={() => {
|
@@ -108,7 +122,7 @@ const Inspectors = memo<InspectorProps>(
|
|
108
122
|
/>
|
109
123
|
<Icon icon={showRender ? ChevronDown : ChevronRight} />
|
110
124
|
</Flexbox>
|
111
|
-
<Flexbox horizontal>
|
125
|
+
<Flexbox className={styles.actions} horizontal>
|
112
126
|
{showRender && (
|
113
127
|
<ActionIcon
|
114
128
|
icon={showPluginRender ? LogsIcon : LayoutPanelTop}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import { Highlighter, Icon } from '@lobehub/ui';
|
2
|
+
import { Button, Tag } from 'antd';
|
3
|
+
import { useTheme } from 'antd-style';
|
4
|
+
import { motion } from 'framer-motion';
|
5
|
+
import { ChevronDown, ChevronRight } from 'lucide-react';
|
6
|
+
import { memo, useState } from 'react';
|
7
|
+
import { useTranslation } from 'react-i18next';
|
8
|
+
import { Flexbox } from 'react-layout-kit';
|
9
|
+
|
10
|
+
import { MCPErrorInfoMetadata } from '@/types/plugins';
|
11
|
+
|
12
|
+
const ErrorDetails = memo<{
|
13
|
+
errorInfo: MCPErrorInfoMetadata;
|
14
|
+
errorMessage?: string;
|
15
|
+
}>(({ errorInfo, errorMessage }) => {
|
16
|
+
const { t } = useTranslation('plugin');
|
17
|
+
const [expanded, setExpanded] = useState(false);
|
18
|
+
|
19
|
+
const theme = useTheme();
|
20
|
+
return (
|
21
|
+
<Flexbox gap={8}>
|
22
|
+
<Button
|
23
|
+
color={'default'}
|
24
|
+
icon={<Icon icon={expanded ? ChevronDown : ChevronRight} />}
|
25
|
+
onClick={() => setExpanded(!expanded)}
|
26
|
+
size="small"
|
27
|
+
style={{
|
28
|
+
fontSize: '12px',
|
29
|
+
padding: '0 4px',
|
30
|
+
}}
|
31
|
+
variant="filled"
|
32
|
+
>
|
33
|
+
{expanded
|
34
|
+
? t('mcpInstall.errorDetails.hideDetails')
|
35
|
+
: t('mcpInstall.errorDetails.showDetails')}
|
36
|
+
</Button>
|
37
|
+
|
38
|
+
{expanded && (
|
39
|
+
<motion.div
|
40
|
+
animate={{ height: 'auto', opacity: 1 }}
|
41
|
+
initial={{ height: 0, opacity: 0 }}
|
42
|
+
style={{ overflow: 'hidden' }}
|
43
|
+
>
|
44
|
+
<Flexbox
|
45
|
+
gap={8}
|
46
|
+
style={{
|
47
|
+
backgroundColor: theme.colorFillQuaternary,
|
48
|
+
borderRadius: 8,
|
49
|
+
fontFamily: 'monospace',
|
50
|
+
fontSize: '11px',
|
51
|
+
padding: '8px 12px',
|
52
|
+
}}
|
53
|
+
>
|
54
|
+
{errorInfo.params && (
|
55
|
+
<Flexbox gap={4}>
|
56
|
+
<div>
|
57
|
+
<Tag bordered={false} color="blue">
|
58
|
+
{t('mcpInstall.errorDetails.connectionParams')}
|
59
|
+
</Tag>
|
60
|
+
</div>
|
61
|
+
<div style={{ marginTop: 4, wordBreak: 'break-all' }}>
|
62
|
+
{errorInfo.params.command && (
|
63
|
+
<div>
|
64
|
+
{t('mcpInstall.errorDetails.command')}: {errorInfo.params.command}
|
65
|
+
</div>
|
66
|
+
)}
|
67
|
+
{errorInfo.params.args && (
|
68
|
+
<div>
|
69
|
+
{t('mcpInstall.errorDetails.args')}: {errorInfo.params.args.join(' ')}
|
70
|
+
</div>
|
71
|
+
)}
|
72
|
+
</div>
|
73
|
+
</Flexbox>
|
74
|
+
)}
|
75
|
+
|
76
|
+
{errorInfo.errorLog && (
|
77
|
+
<Flexbox gap={4}>
|
78
|
+
<div>
|
79
|
+
<Tag bordered={false} color="red">
|
80
|
+
{t('mcpInstall.errorDetails.errorOutput')}
|
81
|
+
</Tag>
|
82
|
+
</div>
|
83
|
+
<Highlighter
|
84
|
+
language={'log'}
|
85
|
+
style={{
|
86
|
+
maxHeight: 200,
|
87
|
+
overflow: 'auto',
|
88
|
+
}}
|
89
|
+
>
|
90
|
+
{errorInfo.errorLog}
|
91
|
+
</Highlighter>
|
92
|
+
</Flexbox>
|
93
|
+
)}
|
94
|
+
|
95
|
+
{errorInfo.originalError && errorInfo.originalError !== errorMessage && (
|
96
|
+
<div>
|
97
|
+
<Tag color="orange">{t('mcpInstall.errorDetails.originalError')}</Tag>
|
98
|
+
<div style={{ marginTop: 4, wordBreak: 'break-all' }}>
|
99
|
+
{errorInfo.originalError}
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
)}
|
103
|
+
</Flexbox>
|
104
|
+
</motion.div>
|
105
|
+
)}
|
106
|
+
</Flexbox>
|
107
|
+
);
|
108
|
+
});
|
109
|
+
|
110
|
+
export default ErrorDetails;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { Alert } from '@lobehub/ui';
|
2
|
+
import { Button } from 'antd';
|
3
|
+
import { memo } from 'react';
|
4
|
+
import { useTranslation } from 'react-i18next';
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
6
|
+
|
7
|
+
import { useToolStore } from '@/store/tool';
|
8
|
+
import { MCPErrorInfo } from '@/types/plugins';
|
9
|
+
|
10
|
+
import ErrorDetails from './ErrorDetails';
|
11
|
+
|
12
|
+
interface InstallErrorProps {
|
13
|
+
errorInfo: MCPErrorInfo;
|
14
|
+
identifier: string;
|
15
|
+
}
|
16
|
+
|
17
|
+
const InstallError = memo<InstallErrorProps>(({ errorInfo, identifier }) => {
|
18
|
+
const { t } = useTranslation(['plugin', 'common']);
|
19
|
+
|
20
|
+
const cancelInstallMCPPlugin = useToolStore((s) => s.cancelInstallMCPPlugin);
|
21
|
+
|
22
|
+
return (
|
23
|
+
<Flexbox gap={8}>
|
24
|
+
<Alert
|
25
|
+
action={
|
26
|
+
<Flexbox>
|
27
|
+
<Button
|
28
|
+
color={'default'}
|
29
|
+
onClick={() => {
|
30
|
+
cancelInstallMCPPlugin(identifier);
|
31
|
+
}}
|
32
|
+
size={'small'}
|
33
|
+
variant={'filled'}
|
34
|
+
>
|
35
|
+
{t('common:close')}
|
36
|
+
</Button>
|
37
|
+
</Flexbox>
|
38
|
+
}
|
39
|
+
message={t('mcpInstall.installError', {
|
40
|
+
detail: t(`mcpInstall.errorTypes.${errorInfo.type}`),
|
41
|
+
})}
|
42
|
+
type="error"
|
43
|
+
variant={'borderless'}
|
44
|
+
/>
|
45
|
+
{errorInfo.metadata && (
|
46
|
+
<ErrorDetails errorInfo={errorInfo.metadata} errorMessage={errorInfo.message} />
|
47
|
+
)}
|
48
|
+
</Flexbox>
|
49
|
+
);
|
50
|
+
});
|
51
|
+
export default InstallError;
|
@@ -0,0 +1,151 @@
|
|
1
|
+
import { Form, Markdown } from '@lobehub/ui';
|
2
|
+
import { Form as AForm, Button } from 'antd';
|
3
|
+
import { createStyles } from 'antd-style';
|
4
|
+
import { motion } from 'framer-motion';
|
5
|
+
import { memo, useState } from 'react';
|
6
|
+
import { useTranslation } from 'react-i18next';
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
8
|
+
|
9
|
+
import ItemRender from '@/components/JSONSchemaConfig/ItemRender';
|
10
|
+
import { transformPluginSettings } from '@/features/PluginSettings';
|
11
|
+
import { useToolStore } from '@/store/tool';
|
12
|
+
|
13
|
+
interface MCPConfigFormProps {
|
14
|
+
configSchema: any;
|
15
|
+
identifier: string;
|
16
|
+
onCancel?: () => void;
|
17
|
+
onSubmit?: (config: Record<string, any>) => Promise<void>;
|
18
|
+
}
|
19
|
+
|
20
|
+
const useStyles = createStyles(({ css, token }) => ({
|
21
|
+
container: css`
|
22
|
+
margin-block-start: ${token.marginXS}px;
|
23
|
+
padding: ${token.padding}px;
|
24
|
+
border: 1px solid ${token.colorBorder};
|
25
|
+
border-radius: ${token.borderRadius}px;
|
26
|
+
|
27
|
+
background-color: ${token.colorBgContainer};
|
28
|
+
`,
|
29
|
+
footer: css`
|
30
|
+
display: flex;
|
31
|
+
gap: ${token.marginXS}px;
|
32
|
+
justify-content: flex-end;
|
33
|
+
|
34
|
+
margin-block-start: ${token.margin}px;
|
35
|
+
padding-block-start: ${token.paddingXS}px;
|
36
|
+
border-block-start: 1px solid ${token.colorBorderSecondary};
|
37
|
+
`,
|
38
|
+
markdown: css`
|
39
|
+
p {
|
40
|
+
color: ${token.colorTextDescription};
|
41
|
+
}
|
42
|
+
`,
|
43
|
+
}));
|
44
|
+
|
45
|
+
const MCPConfigForm = memo<MCPConfigFormProps>(({ configSchema, identifier, onCancel }) => {
|
46
|
+
const { styles } = useStyles();
|
47
|
+
const { t } = useTranslation(['plugin', 'common']);
|
48
|
+
const [form] = AForm.useForm();
|
49
|
+
const [loading, setLoading] = useState(false);
|
50
|
+
|
51
|
+
const { installMCPPlugin } = useToolStore();
|
52
|
+
|
53
|
+
const items = transformPluginSettings(configSchema);
|
54
|
+
|
55
|
+
const handleSubmit = async (values: Record<string, any>) => {
|
56
|
+
setLoading(true);
|
57
|
+
try {
|
58
|
+
await installMCPPlugin(identifier, { config: values, resume: true });
|
59
|
+
} catch (error) {
|
60
|
+
console.error('Config submission failed:', error);
|
61
|
+
} finally {
|
62
|
+
setLoading(false);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
|
66
|
+
const handleCancel = () => {
|
67
|
+
if (onCancel) {
|
68
|
+
onCancel();
|
69
|
+
} else {
|
70
|
+
// 默认行为:清理安装进度
|
71
|
+
useToolStore.getState().updateMCPInstallProgress(identifier, undefined);
|
72
|
+
}
|
73
|
+
};
|
74
|
+
|
75
|
+
return (
|
76
|
+
<motion.div
|
77
|
+
animate={{ y: 0 }}
|
78
|
+
className={styles.container}
|
79
|
+
initial={{ y: 8 }}
|
80
|
+
transition={{ delay: 0.1, duration: 0.2, ease: [0.4, 0, 0.2, 1] }}
|
81
|
+
>
|
82
|
+
<motion.div
|
83
|
+
animate={{ opacity: 1, y: 0 }}
|
84
|
+
initial={{ opacity: 0, y: 4 }}
|
85
|
+
transition={{ delay: 0.15, duration: 0.2 }}
|
86
|
+
>
|
87
|
+
<Flexbox gap={8}>
|
88
|
+
<strong>{t('mcpInstall.configurationRequired')}</strong>
|
89
|
+
<span style={{ fontSize: 12, opacity: 0.7 }}>
|
90
|
+
{t('mcpInstall.configurationDescription')}
|
91
|
+
</span>
|
92
|
+
</Flexbox>
|
93
|
+
</motion.div>
|
94
|
+
|
95
|
+
<motion.div
|
96
|
+
animate={{ opacity: 1, y: 0 }}
|
97
|
+
initial={{ opacity: 0, y: 4 }}
|
98
|
+
transition={{ delay: 0.2, duration: 0.2 }}
|
99
|
+
>
|
100
|
+
<Form
|
101
|
+
form={form}
|
102
|
+
gap={12}
|
103
|
+
items={items
|
104
|
+
.filter((item) => configSchema.required?.includes(item.name))
|
105
|
+
.map((item) => ({
|
106
|
+
children: (
|
107
|
+
<ItemRender
|
108
|
+
enum={item.enum}
|
109
|
+
format={item.format}
|
110
|
+
maximum={item.maximum}
|
111
|
+
minimum={item.minimum}
|
112
|
+
type={item.type as any}
|
113
|
+
/>
|
114
|
+
),
|
115
|
+
desc: item.desc && (
|
116
|
+
<Markdown className={styles.markdown} variant={'chat'}>
|
117
|
+
{item.desc as string}
|
118
|
+
</Markdown>
|
119
|
+
),
|
120
|
+
key: item.label,
|
121
|
+
label: item.label,
|
122
|
+
name: item.name,
|
123
|
+
rules: [{ required: true }],
|
124
|
+
tag: item.tag,
|
125
|
+
valuePropName: item.type === 'boolean' ? 'checked' : undefined,
|
126
|
+
}))}
|
127
|
+
itemsType={'flat'}
|
128
|
+
layout={'vertical'}
|
129
|
+
onFinish={handleSubmit}
|
130
|
+
variant={'borderless'}
|
131
|
+
/>
|
132
|
+
</motion.div>
|
133
|
+
|
134
|
+
<motion.div
|
135
|
+
animate={{ opacity: 1, y: 0 }}
|
136
|
+
className={styles.footer}
|
137
|
+
initial={{ opacity: 0, y: 4 }}
|
138
|
+
transition={{ delay: 0.25, duration: 0.2 }}
|
139
|
+
>
|
140
|
+
<Button onClick={handleCancel} size="small">
|
141
|
+
{t('common:cancel')}
|
142
|
+
</Button>
|
143
|
+
<Button loading={loading} onClick={() => form.submit()} size="small" type="primary">
|
144
|
+
{t('mcpInstall.continueInstall')}
|
145
|
+
</Button>
|
146
|
+
</motion.div>
|
147
|
+
</motion.div>
|
148
|
+
);
|
149
|
+
});
|
150
|
+
|
151
|
+
export default MCPConfigForm;
|