@lobehub/lobehub 2.0.0-next.293 → 2.0.0-next.295
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/.github/workflows/release-desktop-beta.yml +6 -6
- package/.github/workflows/release-desktop-stable.yml +11 -11
- package/CHANGELOG.md +52 -0
- package/apps/desktop/electron.vite.config.ts +0 -1
- package/apps/desktop/src/main/__mocks__/node-mac-permissions.ts +0 -1
- package/apps/desktop/src/main/__mocks__/setup.ts +0 -1
- package/apps/desktop/src/main/controllers/McpCtr.ts +50 -18
- package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -4
- package/apps/desktop/src/main/libs/mcp/client.ts +54 -2
- package/apps/desktop/tsconfig.json +4 -10
- package/changelog/v1.json +14 -0
- package/e2e/scripts/setup.ts +45 -32
- package/package.json +1 -1
- package/packages/database/src/models/__tests__/knowledgeBase.test.ts +1 -1
- package/packages/database/src/repositories/knowledge/index.ts +1 -4
- package/packages/types/src/discover/assistants.ts +2 -2
- package/scripts/migrate-spa-navigation.ts +129 -0
- package/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/route.ts +112 -109
- package/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-user-topics/route.ts +125 -113
- package/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-users/route.ts +74 -65
- package/src/app/[variants]/(auth)/auth-error/page.tsx +1 -1
- package/src/app/[variants]/(auth)/login/[[...login]]/page.tsx +1 -1
- package/src/app/[variants]/(auth)/next-auth/error/AuthErrorPage.tsx +1 -1
- package/src/app/[variants]/(auth)/next-auth/signin/AuthSignInBox.tsx +1 -1
- package/src/app/[variants]/(auth)/oauth/callback/error/page.tsx +1 -1
- package/src/app/[variants]/(auth)/oauth/callback/success/page.tsx +1 -1
- package/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx +1 -1
- package/src/app/[variants]/(auth)/reset-password/layout.tsx +1 -1
- package/src/app/[variants]/(auth)/reset-password/page.tsx +2 -2
- package/src/app/[variants]/(auth)/signin/layout.tsx +1 -1
- package/src/app/[variants]/(auth)/signin/useSignIn.ts +1 -1
- package/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx +2 -2
- package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +1 -1
- package/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx +1 -1
- package/src/app/[variants]/(auth)/verify-email/layout.tsx +1 -1
- package/src/app/[variants]/(auth)/verify-email/page.tsx +2 -2
- package/src/app/[variants]/(main)/_layout/index.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/AgentIdSync.tsx +12 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/CronTopicGroup.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/AddTopicButon.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/hooks/useThreadNavigation.ts +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/hooks/useTopicNavigation.ts +1 -1
- package/src/app/[variants]/(main)/agent/features/TelemetryNotification.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Nav.tsx +9 -9
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Versions/index.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx +1 -2
- package/src/app/[variants]/(main)/community/(detail)/features/ShareButton.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/features/Toc/Heading.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/mcp/features/Details/Versions/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/model/features/Details/Nav.tsx +12 -11
- package/src/app/[variants]/(main)/community/(detail)/model/features/Details/Parameter/ParameterItem.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/provider/features/Details/Nav.tsx +11 -10
- package/src/app/[variants]/(main)/community/(detail)/provider/features/Header.tsx +10 -9
- package/src/app/[variants]/(main)/community/(list)/(home)/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/assistant/features/Category/useCategory.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx +2 -3
- package/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/community/features/CreateButton/Inner.tsx +1 -1
- package/src/app/[variants]/(main)/community/features/CreateButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/features/Search.tsx +1 -2
- package/src/app/[variants]/(main)/community/features/Title.tsx +5 -5
- package/src/app/[variants]/(main)/group/_layout/GroupIdSync.tsx +12 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/AllTopicsDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/hooks/useThreadNavigation.ts +1 -1
- package/src/app/[variants]/(main)/group/features/Conversation/Header/ShareButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/group/features/TelemetryNotification.tsx +2 -3
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/AllAgentsDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +6 -11
- package/src/app/[variants]/(main)/image/NotSupportClient.tsx +4 -3
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx +1 -1
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx +1 -1
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx +1 -1
- package/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx +1 -1
- package/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/memory/features/SourceLink.tsx +1 -1
- package/src/app/[variants]/(main)/page/_layout/Body/AllPagesDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/about/features/ItemCard.tsx +2 -3
- package/src/app/[variants]/(main)/settings/about/features/ItemLink.tsx +2 -3
- package/src/app/[variants]/(main)/settings/about/features/Version.tsx +6 -7
- package/src/app/[variants]/(main)/settings/features/SettingsContent.tsx +1 -1
- package/src/app/[variants]/(main)/settings/features/UpgradeAlert.tsx +4 -4
- package/src/app/[variants]/(main)/settings/provider/(list)/Footer.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +12 -6
- package/src/app/[variants]/(main)/settings/security/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx +1 -1
- package/src/app/[variants]/(main)/settings/stats/features/rankings/AssistantsRank.tsx +1 -1
- package/src/app/[variants]/(main)/settings/stats/features/rankings/TopicsRank.tsx +1 -1
- package/src/app/[variants]/(mobile)/_layout/index.tsx +1 -1
- package/src/app/[variants]/(mobile)/chat/settings/features/AgentInfoDescription/index.tsx +1 -1
- package/src/app/[variants]/(mobile)/chat/settings/features/SettingButton.tsx +1 -1
- package/src/app/[variants]/(mobile)/router/index.tsx +1 -1
- package/src/app/[variants]/page.tsx +1 -1
- package/src/app/[variants]/router/index.tsx +1 -1
- package/src/components/404/index.tsx +4 -4
- package/src/components/Analytics/index.tsx +1 -1
- package/src/components/BrandWatermark/index.tsx +4 -4
- package/src/components/Branding/ProductLogo/Custom.tsx +1 -1
- package/src/components/Error/index.tsx +3 -4
- package/src/components/GoBack/index.tsx +2 -2
- package/src/components/LabsModal/LabCard.tsx +1 -1
- package/src/components/Link.tsx +25 -5
- package/src/components/OllamaSetupGuide/index.tsx +5 -4
- package/src/components/WebFavicon/index.tsx +1 -1
- package/src/components/client/ClientResponsiveContent/index.tsx +1 -1
- package/src/components/client/ClientResponsiveLayout.tsx +1 -1
- package/src/components/mdx/Image.tsx +1 -1
- package/src/components/mdx/Link.tsx +26 -9
- package/src/features/AlertBanner/CloudBanner.tsx +2 -3
- package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +8 -7
- package/src/features/ChatInput/ActionBar/Params/Controls.tsx +1 -3
- package/src/features/ChatInput/ActionBar/Token/index.tsx +1 -1
- package/src/features/ChatInput/Mobile/index.tsx +1 -1
- package/src/features/Conversation/ChatItem/components/MessageContent/index.tsx +1 -1
- package/src/features/Conversation/Error/OllamaBizError/index.tsx +1 -1
- package/src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx +1 -2
- package/src/features/Conversation/Error/index.tsx +1 -1
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/Settings.tsx +1 -1
- package/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +1 -1
- package/src/features/Conversation/Messages/AssistantGroup/index.tsx +1 -1
- package/src/features/Conversation/Messages/Tool/Tool/index.tsx +1 -1
- package/src/features/Conversation/Messages/components/SearchGrounding.tsx +1 -1
- package/src/features/DataImporter/Error.tsx +3 -3
- package/src/features/DevPanel/CacheViewer/cacheProvider.tsx +2 -1
- package/src/features/DevPanel/MetadataViewer/Og.tsx +1 -1
- package/src/features/DevPanel/features/FloatPanel.tsx +1 -1
- package/src/features/DevPanel/features/Table/TooltipContent.tsx +3 -4
- package/src/features/DevPanel/index.tsx +1 -1
- package/src/features/EditorCanvas/InlineToolbar.tsx +1 -6
- package/src/features/FileViewer/NotSupport/index.tsx +2 -3
- package/src/features/Follow/index.tsx +8 -9
- package/src/features/LibraryModal/AddFilesToKnowledgeBase/SelectForm.tsx +2 -2
- package/src/features/MCP/MCPInstallProgress/InstallError/ErrorDetails.tsx +61 -83
- package/src/features/MCP/Scores.tsx +1 -1
- package/src/features/MCPPluginDetail/Nav.tsx +8 -8
- package/src/features/MCPPluginDetail/Overview/TagList.tsx +1 -1
- package/src/features/MobileTabBar/index.tsx +2 -1
- package/src/features/OllamaSetupGuide/Desktop.tsx +1 -2
- package/src/features/PWAInstall/Install.tsx +1 -1
- package/src/features/PWAInstall/index.tsx +1 -1
- package/src/features/PluginDevModal/MCPManifestForm/index.tsx +30 -3
- package/src/features/PluginStore/McpList/index.tsx +1 -1
- package/src/features/PluginStore/PluginList/Detail/Header.tsx +6 -6
- package/src/features/PluginsUI/Render/DefaultType/index.tsx +1 -1
- package/src/features/Portal/Artifacts/Body/Renderer/index.tsx +1 -1
- package/src/features/ResourceManager/components/ChunkDrawer/index.tsx +1 -1
- package/src/features/ResourceManager/components/Explorer/ListView/Skeleton.tsx +26 -26
- package/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx +147 -149
- package/src/features/ResourceManager/index.tsx +1 -1
- package/src/features/Setting/Footer.tsx +4 -5
- package/src/features/User/UserPanel/PanelContent.tsx +1 -1
- package/src/hooks/useActiveTabKey.ts +6 -3
- package/src/hooks/useIsSingleMode.test.ts +10 -24
- package/src/hooks/useIsSingleMode.ts +4 -2
- package/src/hooks/useIsSubSlug.ts +2 -1
- package/src/hooks/useQuery.ts +5 -5
- package/src/layout/GlobalProvider/AppTheme.tsx +2 -2
- package/src/layout/GlobalProvider/StyleRegistry.tsx +1 -1
- package/src/layout/GlobalProvider/useUserStateRedirect.ts +13 -25
- package/src/libs/mcp/types.ts +31 -0
- package/src/libs/next/Image.tsx +13 -0
- package/src/libs/next/Link.tsx +13 -0
- package/src/libs/next/dynamic.tsx +13 -0
- package/src/libs/next/index.ts +22 -0
- package/src/libs/next/navigation.ts +22 -0
- package/src/libs/router/Link.tsx +30 -0
- package/src/libs/router/index.ts +18 -0
- package/src/libs/router/navigation.ts +72 -0
- package/src/server/modules/AgentRuntime/AgentStateManager.ts +5 -1
- package/src/store/chat/slices/portal/selectors.test.ts +5 -15
- package/src/store/page/index.ts +1 -1
- package/src/store/page/slices/crud/index.ts +1 -1
- package/src/store/tool/slices/mcpStore/action.ts +26 -11
- package/src/app/[variants]/(main)/hooks/usePathname.ts +0 -10
- package/src/app/[variants]/(main)/hooks/useQuery.ts +0 -12
- package/src/app/[variants]/(main)/hooks/useRouter.ts +0 -22
- package/src/app/[variants]/(main)/hooks/useSearchParams.ts +0 -11
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flexbox, Highlighter, Tag } from '@lobehub/ui';
|
|
2
2
|
import { cssVar } from 'antd-style';
|
|
3
|
-
import { ChevronDown, ChevronRight } from 'lucide-react';
|
|
4
3
|
import * as motion from 'motion/react-m';
|
|
5
|
-
import { memo
|
|
4
|
+
import { memo } from 'react';
|
|
6
5
|
import { useTranslation } from 'react-i18next';
|
|
7
6
|
|
|
8
7
|
import { type MCPErrorInfoMetadata } from '@/types/plugins';
|
|
@@ -12,94 +11,73 @@ const ErrorDetails = memo<{
|
|
|
12
11
|
errorMessage?: string;
|
|
13
12
|
}>(({ errorInfo, errorMessage }) => {
|
|
14
13
|
const { t } = useTranslation('plugin');
|
|
15
|
-
const [expanded, setExpanded] = useState(false);
|
|
16
14
|
|
|
17
15
|
return (
|
|
18
16
|
<Flexbox gap={8}>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
size="small"
|
|
24
|
-
style={{
|
|
25
|
-
fontSize: '12px',
|
|
26
|
-
padding: '0 4px',
|
|
27
|
-
}}
|
|
28
|
-
variant="filled"
|
|
17
|
+
<motion.div
|
|
18
|
+
animate={{ height: 'auto', opacity: 1 }}
|
|
19
|
+
initial={{ height: 0, opacity: 0 }}
|
|
20
|
+
style={{ overflow: 'hidden' }}
|
|
29
21
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
style={{ overflow: 'hidden' }}
|
|
22
|
+
<Flexbox
|
|
23
|
+
gap={8}
|
|
24
|
+
style={{
|
|
25
|
+
backgroundColor: cssVar.colorFillQuaternary,
|
|
26
|
+
borderRadius: 8,
|
|
27
|
+
fontFamily: 'monospace',
|
|
28
|
+
fontSize: '11px',
|
|
29
|
+
padding: '8px 12px',
|
|
30
|
+
}}
|
|
40
31
|
>
|
|
41
|
-
|
|
42
|
-
gap={
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</div>
|
|
63
|
-
)}
|
|
64
|
-
{errorInfo.params.args && (
|
|
65
|
-
<div>
|
|
66
|
-
{t('mcpInstall.errorDetails.args')}: {errorInfo.params.args.join(' ')}
|
|
67
|
-
</div>
|
|
68
|
-
)}
|
|
69
|
-
</div>
|
|
70
|
-
</Flexbox>
|
|
71
|
-
)}
|
|
72
|
-
|
|
73
|
-
{errorInfo.errorLog && (
|
|
74
|
-
<Flexbox gap={4}>
|
|
75
|
-
<div>
|
|
76
|
-
<Tag color="red" variant={'filled'}>
|
|
77
|
-
{t('mcpInstall.errorDetails.errorOutput')}
|
|
78
|
-
</Tag>
|
|
79
|
-
</div>
|
|
80
|
-
<Highlighter
|
|
81
|
-
language={'log'}
|
|
82
|
-
style={{
|
|
83
|
-
maxHeight: 200,
|
|
84
|
-
overflow: 'auto',
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
{errorInfo.errorLog}
|
|
88
|
-
</Highlighter>
|
|
89
|
-
</Flexbox>
|
|
90
|
-
)}
|
|
32
|
+
{errorInfo.params && (
|
|
33
|
+
<Flexbox gap={4}>
|
|
34
|
+
<div>
|
|
35
|
+
<Tag color="blue" variant={'filled'}>
|
|
36
|
+
{t('mcpInstall.errorDetails.connectionParams')}
|
|
37
|
+
</Tag>
|
|
38
|
+
</div>
|
|
39
|
+
<div style={{ marginTop: 4, wordBreak: 'break-all' }}>
|
|
40
|
+
{errorInfo.params.command && (
|
|
41
|
+
<div>
|
|
42
|
+
{t('mcpInstall.errorDetails.command')}: {errorInfo.params.command}
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
{errorInfo.params.args && (
|
|
46
|
+
<div>
|
|
47
|
+
{t('mcpInstall.errorDetails.args')}: {errorInfo.params.args.join(' ')}
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
</Flexbox>
|
|
52
|
+
)}
|
|
91
53
|
|
|
92
|
-
|
|
54
|
+
{errorInfo.errorLog && (
|
|
55
|
+
<Flexbox gap={4}>
|
|
93
56
|
<div>
|
|
94
|
-
<Tag color="
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</div>
|
|
57
|
+
<Tag color="red" variant={'filled'}>
|
|
58
|
+
{t('mcpInstall.errorDetails.errorOutput')}
|
|
59
|
+
</Tag>
|
|
98
60
|
</div>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
61
|
+
<Highlighter
|
|
62
|
+
language={'log'}
|
|
63
|
+
style={{
|
|
64
|
+
maxHeight: 200,
|
|
65
|
+
overflow: 'auto',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{errorInfo.errorLog}
|
|
69
|
+
</Highlighter>
|
|
70
|
+
</Flexbox>
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
{errorInfo.originalError && errorInfo.originalError !== errorMessage && (
|
|
74
|
+
<div>
|
|
75
|
+
<Tag color="orange">{t('mcpInstall.errorDetails.originalError')}</Tag>
|
|
76
|
+
<div style={{ marginTop: 4, wordBreak: 'break-all' }}>{errorInfo.originalError}</div>
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
79
|
+
</Flexbox>
|
|
80
|
+
</motion.div>
|
|
103
81
|
</Flexbox>
|
|
104
82
|
);
|
|
105
83
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Center, Flexbox, Icon, Tooltip } from '@lobehub/ui';
|
|
4
4
|
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
5
5
|
import { CircleDashedIcon, HammerIcon, LayersIcon, MessageSquareQuoteIcon } from 'lucide-react';
|
|
6
|
-
import Link from '
|
|
6
|
+
import { Link } from '@/libs/router';
|
|
7
7
|
import qs from 'query-string';
|
|
8
8
|
import { memo } from 'react';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
PackageCheckIcon,
|
|
13
13
|
SettingsIcon,
|
|
14
14
|
} from 'lucide-react';
|
|
15
|
-
import Link from 'next/link';
|
|
16
15
|
import { memo } from 'react';
|
|
17
16
|
import { useTranslation } from 'react-i18next';
|
|
18
17
|
import urlJoin from 'url-join';
|
|
@@ -178,21 +177,22 @@ const Nav = memo<NavProps>(
|
|
|
178
177
|
{nav}
|
|
179
178
|
{!inModal && (
|
|
180
179
|
<Flexbox gap={12} horizontal>
|
|
181
|
-
<
|
|
180
|
+
<a className={styles.link} href={SOCIAL_URL.discord} rel="noreferrer" target="_blank">
|
|
182
181
|
{t('mcp.details.nav.needHelp')}
|
|
183
|
-
</
|
|
182
|
+
</a>
|
|
184
183
|
{github?.url && (
|
|
185
184
|
<>
|
|
186
|
-
<
|
|
185
|
+
<a className={styles.link} href={github.url} rel="noreferrer" target="_blank">
|
|
187
186
|
{t('mcp.details.nav.viewSourceCode')}
|
|
188
|
-
</
|
|
189
|
-
<
|
|
187
|
+
</a>
|
|
188
|
+
<a
|
|
190
189
|
className={styles.link}
|
|
191
190
|
href={urlJoin(github.url, 'issues')}
|
|
192
|
-
|
|
191
|
+
rel="noreferrer"
|
|
192
|
+
target="_blank"
|
|
193
193
|
>
|
|
194
194
|
{t('mcp.details.nav.reportIssue')}
|
|
195
|
-
</
|
|
195
|
+
</a>
|
|
196
196
|
</>
|
|
197
197
|
)}
|
|
198
198
|
</Flexbox>
|
|
@@ -2,10 +2,11 @@ import { Icon } from '@lobehub/ui';
|
|
|
2
2
|
import { TabBar, type TabBarProps } from '@lobehub/ui/mobile';
|
|
3
3
|
import { createStaticStyles, cssVar } from 'antd-style';
|
|
4
4
|
import { Bot, MessageSquare, User } from 'lucide-react';
|
|
5
|
-
import { useRouter } from 'next/navigation';
|
|
6
5
|
import { memo, useMemo } from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
8
7
|
|
|
8
|
+
import { useRouter } from '@/libs/router/navigation';
|
|
9
|
+
|
|
9
10
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
10
11
|
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
11
12
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ollama } from '@lobehub/icons';
|
|
2
2
|
import { Center } from '@lobehub/ui';
|
|
3
3
|
import { cssVar } from 'antd-style';
|
|
4
|
-
import Link from 'next/link';
|
|
5
4
|
import { memo } from 'react';
|
|
6
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
7
6
|
|
|
@@ -17,7 +16,7 @@ const OllamaDesktopSetupGuide = memo(() => {
|
|
|
17
16
|
description={
|
|
18
17
|
<span>
|
|
19
18
|
<Trans
|
|
20
|
-
components={[<span key="0" />, <
|
|
19
|
+
components={[<span key="0" />, <a href={'https://ollama.com/download'} key="1" rel="noreferrer" target="_blank" />]}
|
|
21
20
|
i18nKey={'OllamaSetupGuide.install.description'}
|
|
22
21
|
ns={'components'}
|
|
23
22
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { BRANDING_NAME } from '@lobechat/business-const';
|
|
4
|
-
import dynamic from 'next/dynamic';
|
|
4
|
+
import dynamic from '@/libs/next/dynamic';
|
|
5
5
|
import { memo, useEffect, useLayoutEffect } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
@@ -6,8 +6,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
|
|
7
7
|
import KeyValueEditor from '@/components/KeyValueEditor';
|
|
8
8
|
import MCPStdioCommandInput from '@/components/MCPStdioCommandInput';
|
|
9
|
+
import ErrorDetails from '@/features/MCP/MCPInstallProgress/InstallError/ErrorDetails';
|
|
9
10
|
import { useToolStore } from '@/store/tool';
|
|
10
11
|
import { mcpStoreSelectors, pluginSelectors } from '@/store/tool/selectors';
|
|
12
|
+
import { type MCPErrorInfoMetadata } from '@/types/plugins';
|
|
11
13
|
|
|
12
14
|
import ArgsInput from './ArgsInput';
|
|
13
15
|
import CollapsibleSection from './CollapsibleSection';
|
|
@@ -46,10 +48,12 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
|
|
|
46
48
|
const testState = useToolStore(mcpStoreSelectors.getMCPConnectionTestState(identifier), isEqual);
|
|
47
49
|
|
|
48
50
|
const [connectionError, setConnectionError] = useState<string | null>(null);
|
|
51
|
+
const [errorMetadata, setErrorMetadata] = useState<MCPErrorInfoMetadata | null>(null);
|
|
49
52
|
|
|
50
53
|
const handleTestConnection = async () => {
|
|
51
54
|
setIsTesting(true);
|
|
52
55
|
setConnectionError(null);
|
|
56
|
+
setErrorMetadata(null);
|
|
53
57
|
|
|
54
58
|
// Manually trigger validation for fields needed for the test
|
|
55
59
|
let isValid = false;
|
|
@@ -97,12 +101,29 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
|
|
|
97
101
|
// Be careful about overwriting user input if not desired
|
|
98
102
|
form.setFieldsValue({ manifest: result.manifest });
|
|
99
103
|
setConnectionError(null); // 清除本地错误状态
|
|
104
|
+
setErrorMetadata(null);
|
|
100
105
|
} else if (result.error) {
|
|
101
106
|
// Store 已经处理了错误状态,这里可以选择显示额外的用户友好提示
|
|
102
107
|
const errorMessage = t('error.testConnectionFailed', {
|
|
103
108
|
error: result.error,
|
|
104
109
|
});
|
|
105
110
|
setConnectionError(errorMessage);
|
|
111
|
+
|
|
112
|
+
// Build error metadata for detailed display
|
|
113
|
+
if (result.errorLog || mcpType === 'stdio') {
|
|
114
|
+
setErrorMetadata({
|
|
115
|
+
errorLog: result.errorLog,
|
|
116
|
+
params:
|
|
117
|
+
mcpType === 'stdio'
|
|
118
|
+
? {
|
|
119
|
+
args: mcp?.args,
|
|
120
|
+
command: mcp?.command,
|
|
121
|
+
type: 'stdio',
|
|
122
|
+
}
|
|
123
|
+
: undefined,
|
|
124
|
+
timestamp: Date.now(),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
106
127
|
}
|
|
107
128
|
} catch (error) {
|
|
108
129
|
// Handle unexpected errors
|
|
@@ -121,7 +142,10 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
|
|
|
121
142
|
<QuickImportSection
|
|
122
143
|
form={form}
|
|
123
144
|
isEditMode={isEditMode}
|
|
124
|
-
onClearConnectionError={() =>
|
|
145
|
+
onClearConnectionError={() => {
|
|
146
|
+
setConnectionError(null);
|
|
147
|
+
setErrorMetadata(null);
|
|
148
|
+
}}
|
|
125
149
|
/>
|
|
126
150
|
<Form form={form} layout={'vertical'}>
|
|
127
151
|
<Flexbox>
|
|
@@ -270,9 +294,12 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
|
|
|
270
294
|
{(connectionError || testState.error) && (
|
|
271
295
|
<Alert
|
|
272
296
|
closable
|
|
273
|
-
|
|
297
|
+
extra={errorMetadata ? <ErrorDetails errorInfo={errorMetadata} /> : undefined}
|
|
298
|
+
onClose={() => {
|
|
299
|
+
setConnectionError(null);
|
|
300
|
+
setErrorMetadata(null);
|
|
301
|
+
}}
|
|
274
302
|
showIcon
|
|
275
|
-
style={{ marginBottom: 16 }}
|
|
276
303
|
title={connectionError || testState.error}
|
|
277
304
|
type="error"
|
|
278
305
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DraggablePanel, Flexbox } from '@lobehub/ui';
|
|
2
2
|
import { cssVar, useTheme } from 'antd-style';
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
3
|
+
import dynamic from '@/libs/next/dynamic';
|
|
4
4
|
import { memo, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import { useServerConfigStore } from '@/store/serverConfig';
|
|
@@ -4,7 +4,6 @@ import { Github } from '@lobehub/icons';
|
|
|
4
4
|
import { ActionIcon, Avatar, Collapse, Flexbox, Icon, Text } from '@lobehub/ui';
|
|
5
5
|
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
|
|
6
6
|
import { DotIcon } from 'lucide-react';
|
|
7
|
-
import Link from 'next/link';
|
|
8
7
|
import { memo } from 'react';
|
|
9
8
|
import { useTranslation } from 'react-i18next';
|
|
10
9
|
import urlJoin from 'url-join';
|
|
@@ -77,16 +76,17 @@ const Header = memo<{ inModal?: boolean; mobile?: boolean }>(({ mobile: isMobile
|
|
|
77
76
|
</Flexbox>
|
|
78
77
|
{identifier && (
|
|
79
78
|
<Flexbox align={'center'} gap={6} horizontal>
|
|
80
|
-
<
|
|
79
|
+
<a
|
|
81
80
|
href={urlJoin(
|
|
82
81
|
'https://github.com/lobehub/lobe-chat-agents/tree/main/locales',
|
|
83
82
|
identifier,
|
|
84
83
|
)}
|
|
85
84
|
onClick={(e) => e.stopPropagation()}
|
|
86
|
-
|
|
85
|
+
rel="noreferrer"
|
|
86
|
+
target="_blank"
|
|
87
87
|
>
|
|
88
88
|
<ActionIcon fill={cssVar.colorTextDescription} icon={Github} />
|
|
89
|
-
</
|
|
89
|
+
</a>
|
|
90
90
|
</Flexbox>
|
|
91
91
|
)}
|
|
92
92
|
</Flexbox>
|
|
@@ -94,9 +94,9 @@ const Header = memo<{ inModal?: boolean; mobile?: boolean }>(({ mobile: isMobile
|
|
|
94
94
|
<Flexbox>
|
|
95
95
|
<Flexbox align={'center'} gap={4} horizontal>
|
|
96
96
|
{author && (
|
|
97
|
-
<
|
|
97
|
+
<a href={urlJoin('https://github.com', author)} rel="noreferrer" target="_blank">
|
|
98
98
|
{author}
|
|
99
|
-
</
|
|
99
|
+
</a>
|
|
100
100
|
)}
|
|
101
101
|
<Icon icon={DotIcon} />
|
|
102
102
|
<PublishedTime
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Flexbox } from '@lobehub/ui';
|
|
2
2
|
import { Drawer } from 'antd';
|
|
3
3
|
import { cssVar } from 'antd-style';
|
|
4
|
-
import dynamic from 'next/dynamic';
|
|
4
|
+
import dynamic from '@/libs/next/dynamic';
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { fileManagerSelectors, useFileStore } from '@/store/file';
|
|
@@ -34,33 +34,33 @@ const ListViewSkeleton = ({
|
|
|
34
34
|
opacity: getOpacity(index),
|
|
35
35
|
}}
|
|
36
36
|
>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
<Center height={40} style={{ paddingInline: 4 }}>
|
|
38
|
+
<Checkbox disabled />
|
|
39
|
+
</Center>
|
|
40
|
+
<Flexbox
|
|
41
|
+
align={'center'}
|
|
42
|
+
horizontal
|
|
43
|
+
style={{
|
|
44
|
+
flexShrink: 0,
|
|
45
|
+
maxWidth: columnWidths.name,
|
|
46
|
+
minWidth: columnWidths.name,
|
|
47
|
+
paddingInline: 8,
|
|
48
|
+
width: columnWidths.name,
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<Skeleton.Avatar active shape={'square'} size={24} style={{ marginInline: 8 }} />
|
|
52
|
+
<Skeleton.Button active style={{ height: 16, width: '60%' }} />
|
|
53
|
+
</Flexbox>
|
|
54
|
+
<Flexbox style={{ flexShrink: 0, paddingInline: '0 24px' }} width={columnWidths.date}>
|
|
55
|
+
<Skeleton.Button active style={{ height: 16, width: '80%' }} />
|
|
56
|
+
</Flexbox>
|
|
57
|
+
<Flexbox style={{ flexShrink: 0, paddingInline: '0 24px' }} width={columnWidths.size}>
|
|
58
|
+
<Skeleton.Button active style={{ height: 16, width: '60%' }} />
|
|
59
|
+
</Flexbox>
|
|
59
60
|
</Flexbox>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
61
|
+
))}
|
|
62
|
+
</Flexbox>
|
|
63
|
+
);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export default ListViewSkeleton;
|