@mcp-shark/mcp-shark 1.4.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/LICENSE +85 -0
- package/README.md +724 -0
- package/bin/mcp-shark.js +93 -0
- package/mcp-server/.editorconfig +15 -0
- package/mcp-server/.prettierignore +11 -0
- package/mcp-server/.prettierrc +12 -0
- package/mcp-server/README.md +280 -0
- package/mcp-server/commitlint.config.cjs +42 -0
- package/mcp-server/eslint.config.js +131 -0
- package/mcp-server/lib/auditor/audit.js +228 -0
- package/mcp-server/lib/common/error.js +15 -0
- package/mcp-server/lib/server/external/all.js +32 -0
- package/mcp-server/lib/server/external/config.js +59 -0
- package/mcp-server/lib/server/external/kv.js +102 -0
- package/mcp-server/lib/server/external/single/client.js +35 -0
- package/mcp-server/lib/server/external/single/request.js +49 -0
- package/mcp-server/lib/server/external/single/run.js +75 -0
- package/mcp-server/lib/server/external/single/transport.js +57 -0
- package/mcp-server/lib/server/internal/handlers/common.js +20 -0
- package/mcp-server/lib/server/internal/handlers/error.js +7 -0
- package/mcp-server/lib/server/internal/handlers/prompts-get.js +22 -0
- package/mcp-server/lib/server/internal/handlers/prompts-list.js +12 -0
- package/mcp-server/lib/server/internal/handlers/resources-list.js +12 -0
- package/mcp-server/lib/server/internal/handlers/resources-read.js +19 -0
- package/mcp-server/lib/server/internal/handlers/tools-call.js +37 -0
- package/mcp-server/lib/server/internal/handlers/tools-list.js +14 -0
- package/mcp-server/lib/server/internal/run.js +49 -0
- package/mcp-server/lib/server/internal/server.js +63 -0
- package/mcp-server/lib/server/internal/session.js +39 -0
- package/mcp-server/mcp-shark.js +72 -0
- package/mcp-server/package-lock.json +4784 -0
- package/mcp-server/package.json +30 -0
- package/package.json +103 -0
- package/ui/README.md +212 -0
- package/ui/index.html +16 -0
- package/ui/package-lock.json +3574 -0
- package/ui/package.json +12 -0
- package/ui/paths.js +282 -0
- package/ui/public/og-image.png +0 -0
- package/ui/server/routes/backups.js +251 -0
- package/ui/server/routes/composite.js +244 -0
- package/ui/server/routes/config.js +175 -0
- package/ui/server/routes/conversations.js +25 -0
- package/ui/server/routes/help.js +43 -0
- package/ui/server/routes/logs.js +32 -0
- package/ui/server/routes/playground.js +152 -0
- package/ui/server/routes/requests.js +235 -0
- package/ui/server/routes/sessions.js +27 -0
- package/ui/server/routes/smartscan/discover.js +117 -0
- package/ui/server/routes/smartscan/scans/clearCache.js +22 -0
- package/ui/server/routes/smartscan/scans/createBatchScans.js +123 -0
- package/ui/server/routes/smartscan/scans/createScan.js +42 -0
- package/ui/server/routes/smartscan/scans/getCachedResults.js +51 -0
- package/ui/server/routes/smartscan/scans/getScan.js +41 -0
- package/ui/server/routes/smartscan/scans/listScans.js +24 -0
- package/ui/server/routes/smartscan/scans.js +13 -0
- package/ui/server/routes/smartscan/token.js +56 -0
- package/ui/server/routes/smartscan/transport.js +53 -0
- package/ui/server/routes/smartscan.js +24 -0
- package/ui/server/routes/statistics.js +83 -0
- package/ui/server/utils/config-update.js +212 -0
- package/ui/server/utils/config.js +98 -0
- package/ui/server/utils/paths.js +23 -0
- package/ui/server/utils/port.js +28 -0
- package/ui/server/utils/process.js +80 -0
- package/ui/server/utils/scan-cache/all-results.js +180 -0
- package/ui/server/utils/scan-cache/directory.js +35 -0
- package/ui/server/utils/scan-cache/file-operations.js +104 -0
- package/ui/server/utils/scan-cache/hash.js +47 -0
- package/ui/server/utils/scan-cache/server-operations.js +80 -0
- package/ui/server/utils/scan-cache.js +12 -0
- package/ui/server/utils/serialization.js +13 -0
- package/ui/server/utils/smartscan-token.js +42 -0
- package/ui/server.js +199 -0
- package/ui/src/App.jsx +153 -0
- package/ui/src/CompositeLogs.jsx +164 -0
- package/ui/src/CompositeSetup.jsx +285 -0
- package/ui/src/HelpGuide/HelpGuideContent.jsx +118 -0
- package/ui/src/HelpGuide/HelpGuideFooter.jsx +58 -0
- package/ui/src/HelpGuide/HelpGuideHeader.jsx +56 -0
- package/ui/src/HelpGuide.jsx +65 -0
- package/ui/src/IntroTour.jsx +140 -0
- package/ui/src/LogDetail.jsx +122 -0
- package/ui/src/LogTable.jsx +242 -0
- package/ui/src/PacketDetail.jsx +190 -0
- package/ui/src/PacketFilters.jsx +222 -0
- package/ui/src/PacketList.jsx +183 -0
- package/ui/src/SmartScan.jsx +178 -0
- package/ui/src/TabNavigation.jsx +143 -0
- package/ui/src/components/App/HelpButton.jsx +64 -0
- package/ui/src/components/App/TrafficTab.jsx +69 -0
- package/ui/src/components/App/useAppState.js +163 -0
- package/ui/src/components/BackupList.jsx +192 -0
- package/ui/src/components/CollapsibleSection.jsx +82 -0
- package/ui/src/components/ConfigFileSection.jsx +84 -0
- package/ui/src/components/ConfigViewerModal.jsx +141 -0
- package/ui/src/components/ConfirmationModal.jsx +129 -0
- package/ui/src/components/DetailsTab/BodySection.jsx +27 -0
- package/ui/src/components/DetailsTab/CollapsibleRequestResponse.jsx +70 -0
- package/ui/src/components/DetailsTab/HeadersSection.jsx +25 -0
- package/ui/src/components/DetailsTab/InfoSection.jsx +28 -0
- package/ui/src/components/DetailsTab/NetworkInfoSection.jsx +63 -0
- package/ui/src/components/DetailsTab/ProtocolInfoSection.jsx +75 -0
- package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +46 -0
- package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +66 -0
- package/ui/src/components/DetailsTab.jsx +31 -0
- package/ui/src/components/DetectedPathsList.jsx +171 -0
- package/ui/src/components/FileInput.jsx +144 -0
- package/ui/src/components/GroupHeader.jsx +76 -0
- package/ui/src/components/GroupedByMcpView.jsx +103 -0
- package/ui/src/components/GroupedByServerView.jsx +134 -0
- package/ui/src/components/GroupedBySessionView.jsx +127 -0
- package/ui/src/components/GroupedViews.jsx +2 -0
- package/ui/src/components/HexTab.jsx +188 -0
- package/ui/src/components/LogsDisplay.jsx +93 -0
- package/ui/src/components/LogsToolbar.jsx +193 -0
- package/ui/src/components/McpPlayground/LoadingModal.jsx +113 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptCallPanel.jsx +125 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptItem.jsx +48 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptsList.jsx +45 -0
- package/ui/src/components/McpPlayground/PromptsSection.jsx +106 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourceCallPanel.jsx +89 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourceItem.jsx +59 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourcesList.jsx +45 -0
- package/ui/src/components/McpPlayground/ResourcesSection.jsx +91 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolCallPanel.jsx +125 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolItem.jsx +48 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolsList.jsx +45 -0
- package/ui/src/components/McpPlayground/ToolsSection.jsx +107 -0
- package/ui/src/components/McpPlayground/common/EmptyState.jsx +17 -0
- package/ui/src/components/McpPlayground/common/ErrorState.jsx +17 -0
- package/ui/src/components/McpPlayground/common/LoadingState.jsx +17 -0
- package/ui/src/components/McpPlayground/useMcpPlayground.js +280 -0
- package/ui/src/components/McpPlayground.jsx +171 -0
- package/ui/src/components/MessageDisplay.jsx +28 -0
- package/ui/src/components/PacketDetailHeader.jsx +88 -0
- package/ui/src/components/PacketFilters/ExportControls.jsx +126 -0
- package/ui/src/components/PacketFilters/FilterInput.jsx +59 -0
- package/ui/src/components/RawTab.jsx +142 -0
- package/ui/src/components/RequestRow/OrphanedResponseRow.jsx +155 -0
- package/ui/src/components/RequestRow/RequestRowMain.jsx +240 -0
- package/ui/src/components/RequestRow/ResponseRow.jsx +158 -0
- package/ui/src/components/RequestRow.jsx +70 -0
- package/ui/src/components/ServerControl.jsx +133 -0
- package/ui/src/components/ServiceSelector.jsx +209 -0
- package/ui/src/components/SetupHeader.jsx +30 -0
- package/ui/src/components/SharkLogo.jsx +21 -0
- package/ui/src/components/SmartScan/AnalysisResult.jsx +64 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultItem.jsx +215 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultsHeader.jsx +94 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay.jsx +26 -0
- package/ui/src/components/SmartScan/DebugInfoSection.jsx +53 -0
- package/ui/src/components/SmartScan/EmptyState.jsx +57 -0
- package/ui/src/components/SmartScan/ErrorDisplay.jsx +48 -0
- package/ui/src/components/SmartScan/ExpandableSection.jsx +93 -0
- package/ui/src/components/SmartScan/FindingsTable.jsx +257 -0
- package/ui/src/components/SmartScan/ListViewContent.jsx +75 -0
- package/ui/src/components/SmartScan/NotablePatternsSection.jsx +75 -0
- package/ui/src/components/SmartScan/OverallSummarySection.jsx +72 -0
- package/ui/src/components/SmartScan/RawDataSection.jsx +52 -0
- package/ui/src/components/SmartScan/RecommendationsSection.jsx +78 -0
- package/ui/src/components/SmartScan/ScanDetailHeader.jsx +92 -0
- package/ui/src/components/SmartScan/ScanDetailView.jsx +141 -0
- package/ui/src/components/SmartScan/ScanListView/ScanListHeader.jsx +49 -0
- package/ui/src/components/SmartScan/ScanListView/ScanListItem.jsx +201 -0
- package/ui/src/components/SmartScan/ScanListView.jsx +73 -0
- package/ui/src/components/SmartScan/ScanOverviewSection.jsx +123 -0
- package/ui/src/components/SmartScan/ScanResultsDisplay.jsx +35 -0
- package/ui/src/components/SmartScan/ScanViewContent.jsx +68 -0
- package/ui/src/components/SmartScan/ScanningProgress.jsx +47 -0
- package/ui/src/components/SmartScan/ServerInfoSection.jsx +43 -0
- package/ui/src/components/SmartScan/ServerSelectionRow.jsx +207 -0
- package/ui/src/components/SmartScan/SingleResultDisplay.jsx +269 -0
- package/ui/src/components/SmartScan/SmartScanControls.jsx +290 -0
- package/ui/src/components/SmartScan/SmartScanHeader.jsx +77 -0
- package/ui/src/components/SmartScan/ViewModeTabs.jsx +57 -0
- package/ui/src/components/SmartScan/hooks/useCacheManagement.js +34 -0
- package/ui/src/components/SmartScan/hooks/useMcpDiscovery.js +121 -0
- package/ui/src/components/SmartScan/hooks/useScanList.js +193 -0
- package/ui/src/components/SmartScan/hooks/useScanOperations.js +87 -0
- package/ui/src/components/SmartScan/hooks/useServerStatus.js +26 -0
- package/ui/src/components/SmartScan/hooks/useTokenManagement.js +53 -0
- package/ui/src/components/SmartScan/scanDataUtils.js +98 -0
- package/ui/src/components/SmartScan/useSmartScan.js +72 -0
- package/ui/src/components/SmartScan/utils.js +19 -0
- package/ui/src/components/SmartScanIcons.jsx +58 -0
- package/ui/src/components/TabNavigation/DesktopTabs.jsx +111 -0
- package/ui/src/components/TabNavigation/MobileDropdown.jsx +140 -0
- package/ui/src/components/TabNavigation.jsx +97 -0
- package/ui/src/components/TabNavigationIcons.jsx +40 -0
- package/ui/src/components/TableHeader.jsx +164 -0
- package/ui/src/components/TourOverlay.jsx +117 -0
- package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +117 -0
- package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +70 -0
- package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +45 -0
- package/ui/src/components/TourTooltip/useTooltipPosition.js +108 -0
- package/ui/src/components/TourTooltip.jsx +83 -0
- package/ui/src/components/ViewModeTabs.jsx +91 -0
- package/ui/src/components/WhatThisDoesSection.jsx +61 -0
- package/ui/src/config/tourSteps.jsx +141 -0
- package/ui/src/hooks/useAnimation.js +92 -0
- package/ui/src/hooks/useConfigManagement.js +124 -0
- package/ui/src/hooks/useServiceExtraction.js +51 -0
- package/ui/src/index.css +42 -0
- package/ui/src/main.jsx +10 -0
- package/ui/src/theme.js +65 -0
- package/ui/src/utils/animations.js +170 -0
- package/ui/src/utils/groupingUtils.js +93 -0
- package/ui/src/utils/hexUtils.js +24 -0
- package/ui/src/utils/mcpGroupingUtils.js +262 -0
- package/ui/src/utils/requestUtils.js +297 -0
- package/ui/vite.config.js +18 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import CollapsibleSection from '../CollapsibleSection';
|
|
3
|
+
|
|
4
|
+
export default function ProtocolInfoSection({ data, titleColor }) {
|
|
5
|
+
return (
|
|
6
|
+
<CollapsibleSection title={`${data.protocol || 'HTTP'} Protocol`}>
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
fontSize: '12px',
|
|
10
|
+
color: colors.textPrimary,
|
|
11
|
+
fontFamily: fonts.body,
|
|
12
|
+
marginBottom: '4px',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
Direction: <span style={{ color: titleColor, fontWeight: '500' }}>{data.direction}</span>
|
|
16
|
+
</div>
|
|
17
|
+
{data.status_code && (
|
|
18
|
+
<div
|
|
19
|
+
style={{
|
|
20
|
+
fontSize: '12px',
|
|
21
|
+
color: colors.textPrimary,
|
|
22
|
+
fontFamily: fonts.body,
|
|
23
|
+
marginBottom: '4px',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
Status Code:{' '}
|
|
27
|
+
<span
|
|
28
|
+
style={{
|
|
29
|
+
color:
|
|
30
|
+
data.status_code >= 400
|
|
31
|
+
? colors.error
|
|
32
|
+
: data.status_code >= 300
|
|
33
|
+
? colors.warning
|
|
34
|
+
: colors.success,
|
|
35
|
+
fontFamily: fonts.mono,
|
|
36
|
+
fontWeight: '600',
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
{data.status_code}
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
{data.jsonrpc_method && (
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
fontSize: '12px',
|
|
47
|
+
color: colors.textPrimary,
|
|
48
|
+
fontFamily: fonts.body,
|
|
49
|
+
marginBottom: '4px',
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
JSON-RPC Method:{' '}
|
|
53
|
+
<span style={{ color: colors.textSecondary, fontFamily: fonts.mono }}>
|
|
54
|
+
{data.jsonrpc_method}
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
{data.jsonrpc_id && (
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
fontSize: '12px',
|
|
62
|
+
color: colors.textPrimary,
|
|
63
|
+
fontFamily: fonts.body,
|
|
64
|
+
marginBottom: '4px',
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
JSON-RPC ID:{' '}
|
|
68
|
+
<span style={{ color: colors.textSecondary, fontFamily: fonts.mono }}>
|
|
69
|
+
{data.jsonrpc_id}
|
|
70
|
+
</span>
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
</CollapsibleSection>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { colors } from '../../theme';
|
|
2
|
+
import CollapsibleRequestResponse from './CollapsibleRequestResponse';
|
|
3
|
+
import NetworkInfoSection from './NetworkInfoSection';
|
|
4
|
+
import ProtocolInfoSection from './ProtocolInfoSection';
|
|
5
|
+
import HeadersSection from './HeadersSection';
|
|
6
|
+
import BodySection from './BodySection';
|
|
7
|
+
import InfoSection from './InfoSection';
|
|
8
|
+
import CollapsibleSection from '../CollapsibleSection';
|
|
9
|
+
|
|
10
|
+
export default function RequestDetailsSection({ request, requestHeaders, requestBody }) {
|
|
11
|
+
if (!request) return null;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<CollapsibleRequestResponse
|
|
15
|
+
title="Request"
|
|
16
|
+
titleColor={colors.accentBlue}
|
|
17
|
+
defaultExpanded={true}
|
|
18
|
+
>
|
|
19
|
+
<InfoSection data={request} titleColor={colors.accentBlue} />
|
|
20
|
+
<NetworkInfoSection data={request} showUserAgent={true} />
|
|
21
|
+
<ProtocolInfoSection data={request} titleColor={colors.accentBlue} />
|
|
22
|
+
<HeadersSection headers={requestHeaders} titleColor={colors.accentBlue} />
|
|
23
|
+
<BodySection body={requestBody} titleColor={colors.accentBlue} />
|
|
24
|
+
{request.jsonrpc_params && (
|
|
25
|
+
<CollapsibleSection title="JSON-RPC Params" titleColor={colors.accentBlue}>
|
|
26
|
+
<pre
|
|
27
|
+
style={{
|
|
28
|
+
background: colors.bgSecondary,
|
|
29
|
+
padding: '16px',
|
|
30
|
+
borderRadius: '8px',
|
|
31
|
+
overflow: 'auto',
|
|
32
|
+
fontSize: '12px',
|
|
33
|
+
fontFamily: 'monospace',
|
|
34
|
+
maxHeight: '400px',
|
|
35
|
+
border: `1px solid ${colors.borderLight}`,
|
|
36
|
+
color: colors.textPrimary,
|
|
37
|
+
lineHeight: '1.5',
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{JSON.stringify(JSON.parse(request.jsonrpc_params), null, 2)}
|
|
41
|
+
</pre>
|
|
42
|
+
</CollapsibleSection>
|
|
43
|
+
)}
|
|
44
|
+
</CollapsibleRequestResponse>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import CollapsibleRequestResponse from './CollapsibleRequestResponse';
|
|
3
|
+
import NetworkInfoSection from './NetworkInfoSection';
|
|
4
|
+
import ProtocolInfoSection from './ProtocolInfoSection';
|
|
5
|
+
import HeadersSection from './HeadersSection';
|
|
6
|
+
import BodySection from './BodySection';
|
|
7
|
+
import InfoSection from './InfoSection';
|
|
8
|
+
import CollapsibleSection from '../CollapsibleSection';
|
|
9
|
+
|
|
10
|
+
export default function ResponseDetailsSection({ response, responseHeaders, responseBody }) {
|
|
11
|
+
if (!response) return null;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<CollapsibleRequestResponse
|
|
15
|
+
title="Response"
|
|
16
|
+
titleColor={colors.accentGreen}
|
|
17
|
+
defaultExpanded={true}
|
|
18
|
+
>
|
|
19
|
+
<InfoSection data={response} titleColor={colors.accentGreen} />
|
|
20
|
+
<NetworkInfoSection data={response} />
|
|
21
|
+
<ProtocolInfoSection data={response} titleColor={colors.accentGreen} />
|
|
22
|
+
<HeadersSection headers={responseHeaders} titleColor={colors.accentGreen} />
|
|
23
|
+
<BodySection body={responseBody} titleColor={colors.accentGreen} />
|
|
24
|
+
{response.jsonrpc_result && (
|
|
25
|
+
<CollapsibleSection title="JSON-RPC Result" titleColor={colors.accentGreen}>
|
|
26
|
+
<pre
|
|
27
|
+
style={{
|
|
28
|
+
background: colors.bgSecondary,
|
|
29
|
+
padding: '16px',
|
|
30
|
+
borderRadius: '8px',
|
|
31
|
+
overflow: 'auto',
|
|
32
|
+
fontSize: '12px',
|
|
33
|
+
fontFamily: fonts.mono,
|
|
34
|
+
maxHeight: '400px',
|
|
35
|
+
border: `1px solid ${colors.borderLight}`,
|
|
36
|
+
color: colors.textPrimary,
|
|
37
|
+
lineHeight: '1.5',
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{JSON.stringify(JSON.parse(response.jsonrpc_result), null, 2)}
|
|
41
|
+
</pre>
|
|
42
|
+
</CollapsibleSection>
|
|
43
|
+
)}
|
|
44
|
+
{response.jsonrpc_error && (
|
|
45
|
+
<CollapsibleSection title="JSON-RPC Error" titleColor={colors.error}>
|
|
46
|
+
<pre
|
|
47
|
+
style={{
|
|
48
|
+
background: colors.bgSecondary,
|
|
49
|
+
padding: '16px',
|
|
50
|
+
borderRadius: '8px',
|
|
51
|
+
overflow: 'auto',
|
|
52
|
+
fontSize: '12px',
|
|
53
|
+
fontFamily: fonts.mono,
|
|
54
|
+
maxHeight: '400px',
|
|
55
|
+
border: `1px solid ${colors.borderLight}`,
|
|
56
|
+
color: colors.error,
|
|
57
|
+
lineHeight: '1.5',
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
{JSON.stringify(JSON.parse(response.jsonrpc_error), null, 2)}
|
|
61
|
+
</pre>
|
|
62
|
+
</CollapsibleSection>
|
|
63
|
+
)}
|
|
64
|
+
</CollapsibleRequestResponse>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { colors } from '../theme';
|
|
2
|
+
import RequestDetailsSection from './DetailsTab/RequestDetailsSection';
|
|
3
|
+
import ResponseDetailsSection from './DetailsTab/ResponseDetailsSection';
|
|
4
|
+
|
|
5
|
+
function DetailsTab({
|
|
6
|
+
request,
|
|
7
|
+
response,
|
|
8
|
+
requestHeaders,
|
|
9
|
+
requestBody,
|
|
10
|
+
responseHeaders,
|
|
11
|
+
responseBody,
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<div style={{ padding: '20px', overflow: 'auto', flex: 1, background: colors.bgPrimary }}>
|
|
15
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '0' }}>
|
|
16
|
+
<RequestDetailsSection
|
|
17
|
+
request={request}
|
|
18
|
+
requestHeaders={requestHeaders}
|
|
19
|
+
requestBody={requestBody}
|
|
20
|
+
/>
|
|
21
|
+
<ResponseDetailsSection
|
|
22
|
+
response={response}
|
|
23
|
+
responseHeaders={responseHeaders}
|
|
24
|
+
responseBody={responseBody}
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default DetailsTab;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
import { IconRefresh, IconEye, IconCode, IconClock } from '@tabler/icons-react';
|
|
3
|
+
|
|
4
|
+
function DetectedPathsList({ detectedPaths, detecting, onDetect, onSelect, onView }) {
|
|
5
|
+
if (detectedPaths.length === 0) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div style={{ marginBottom: '8px' }}>
|
|
11
|
+
<div
|
|
12
|
+
style={{
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'space-between',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
marginBottom: '8px',
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
style={{
|
|
21
|
+
fontSize: '13px',
|
|
22
|
+
color: colors.textPrimary,
|
|
23
|
+
fontWeight: '600',
|
|
24
|
+
fontFamily: fonts.body,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
Detected Configuration Files:
|
|
28
|
+
</div>
|
|
29
|
+
<button
|
|
30
|
+
onClick={onDetect}
|
|
31
|
+
disabled={detecting}
|
|
32
|
+
title="Refresh detection"
|
|
33
|
+
style={{
|
|
34
|
+
padding: '4px 8px',
|
|
35
|
+
background: 'transparent',
|
|
36
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
37
|
+
color: colors.textSecondary,
|
|
38
|
+
cursor: detecting ? 'not-allowed' : 'pointer',
|
|
39
|
+
fontSize: '11px',
|
|
40
|
+
borderRadius: '8px',
|
|
41
|
+
opacity: detecting ? 0.5 : 1,
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
gap: '4px',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{detecting ? (
|
|
48
|
+
<>
|
|
49
|
+
<IconRefresh
|
|
50
|
+
size={12}
|
|
51
|
+
stroke={1.5}
|
|
52
|
+
style={{ animation: 'spin 1s linear infinite' }}
|
|
53
|
+
/>
|
|
54
|
+
<span>Detecting...</span>
|
|
55
|
+
</>
|
|
56
|
+
) : (
|
|
57
|
+
<>
|
|
58
|
+
<IconRefresh size={12} stroke={1.5} />
|
|
59
|
+
<span>Refresh</span>
|
|
60
|
+
</>
|
|
61
|
+
)}
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
<div
|
|
65
|
+
data-tour="detected-editors"
|
|
66
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}
|
|
67
|
+
>
|
|
68
|
+
{detectedPaths.map((item, idx) => (
|
|
69
|
+
<button
|
|
70
|
+
key={idx}
|
|
71
|
+
data-tour={idx === 0 ? 'first-detected-editor' : undefined}
|
|
72
|
+
onClick={() => onSelect(item.path)}
|
|
73
|
+
onDoubleClick={() => {
|
|
74
|
+
if (item.exists) {
|
|
75
|
+
onView(item.path);
|
|
76
|
+
}
|
|
77
|
+
}}
|
|
78
|
+
style={{
|
|
79
|
+
padding: '8px 12px',
|
|
80
|
+
background: item.exists ? `${colors.accentBlue}20` : colors.bgSecondary,
|
|
81
|
+
border: `1px solid ${item.exists ? colors.accentBlue : colors.borderMedium}`,
|
|
82
|
+
color: colors.textPrimary,
|
|
83
|
+
cursor: 'pointer',
|
|
84
|
+
fontSize: '12px',
|
|
85
|
+
borderRadius: '8px',
|
|
86
|
+
textAlign: 'left',
|
|
87
|
+
display: 'flex',
|
|
88
|
+
justifyContent: 'space-between',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
transition: 'all 0.2s',
|
|
91
|
+
}}
|
|
92
|
+
onMouseEnter={(e) => {
|
|
93
|
+
e.currentTarget.style.background = item.exists
|
|
94
|
+
? `${colors.accentBlue}30`
|
|
95
|
+
: colors.bgHover;
|
|
96
|
+
}}
|
|
97
|
+
onMouseLeave={(e) => {
|
|
98
|
+
e.currentTarget.style.background = item.exists
|
|
99
|
+
? `${colors.accentBlue}20`
|
|
100
|
+
: colors.bgSecondary;
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
104
|
+
<span style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
105
|
+
{item.editor === 'Cursor' ? (
|
|
106
|
+
<IconCode size={14} stroke={1.5} />
|
|
107
|
+
) : (
|
|
108
|
+
<IconClock size={14} stroke={1.5} />
|
|
109
|
+
)}
|
|
110
|
+
</span>
|
|
111
|
+
<div>
|
|
112
|
+
<div style={{ fontWeight: '500' }}>{item.editor}</div>
|
|
113
|
+
<div
|
|
114
|
+
style={{
|
|
115
|
+
fontSize: '12px',
|
|
116
|
+
color: colors.textSecondary,
|
|
117
|
+
fontFamily: fonts.body,
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{item.displayPath}
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div style={{ display: 'flex', gap: '6px', alignItems: 'center' }}>
|
|
125
|
+
{item.exists && (
|
|
126
|
+
<>
|
|
127
|
+
<span
|
|
128
|
+
style={{
|
|
129
|
+
fontSize: '10px',
|
|
130
|
+
padding: '2px 6px',
|
|
131
|
+
background: colors.success,
|
|
132
|
+
color: colors.textInverse,
|
|
133
|
+
borderRadius: '6px',
|
|
134
|
+
fontWeight: '500',
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
Found
|
|
138
|
+
</span>
|
|
139
|
+
<button
|
|
140
|
+
onClick={(e) => {
|
|
141
|
+
e.stopPropagation();
|
|
142
|
+
onView(item.path);
|
|
143
|
+
}}
|
|
144
|
+
title="View file content"
|
|
145
|
+
style={{
|
|
146
|
+
fontSize: '10px',
|
|
147
|
+
padding: '2px 6px',
|
|
148
|
+
background: 'transparent',
|
|
149
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
150
|
+
color: colors.textSecondary,
|
|
151
|
+
borderRadius: '6px',
|
|
152
|
+
cursor: 'pointer',
|
|
153
|
+
display: 'flex',
|
|
154
|
+
alignItems: 'center',
|
|
155
|
+
gap: '4px',
|
|
156
|
+
}}
|
|
157
|
+
>
|
|
158
|
+
<IconEye size={10} stroke={1.5} />
|
|
159
|
+
<span>View</span>
|
|
160
|
+
</button>
|
|
161
|
+
</>
|
|
162
|
+
)}
|
|
163
|
+
</div>
|
|
164
|
+
</button>
|
|
165
|
+
))}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export default DetectedPathsList;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
import { IconFileUpload } from '@tabler/icons-react';
|
|
3
|
+
|
|
4
|
+
function FileInput({
|
|
5
|
+
filePath,
|
|
6
|
+
fileContent,
|
|
7
|
+
updatePath,
|
|
8
|
+
onFileSelect,
|
|
9
|
+
onPathChange,
|
|
10
|
+
onUpdatePathChange,
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
|
|
15
|
+
<label
|
|
16
|
+
data-tour="select-file"
|
|
17
|
+
style={{
|
|
18
|
+
padding: '8px 16px',
|
|
19
|
+
background: colors.buttonPrimary,
|
|
20
|
+
border: `1px solid ${colors.buttonPrimary}`,
|
|
21
|
+
color: colors.textInverse,
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
fontSize: '13px',
|
|
24
|
+
borderRadius: '8px',
|
|
25
|
+
fontWeight: '500',
|
|
26
|
+
whiteSpace: 'nowrap',
|
|
27
|
+
transition: 'background 0.2s',
|
|
28
|
+
}}
|
|
29
|
+
onMouseEnter={(e) => {
|
|
30
|
+
e.currentTarget.style.background = colors.buttonPrimaryHover;
|
|
31
|
+
}}
|
|
32
|
+
onMouseLeave={(e) => {
|
|
33
|
+
e.currentTarget.style.background = colors.buttonPrimary;
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<IconFileUpload
|
|
37
|
+
size={14}
|
|
38
|
+
stroke={1.5}
|
|
39
|
+
style={{ marginRight: '6px', display: 'inline-block' }}
|
|
40
|
+
/>
|
|
41
|
+
Select File
|
|
42
|
+
<input type="file" accept=".json" onChange={onFileSelect} style={{ display: 'none' }} />
|
|
43
|
+
</label>
|
|
44
|
+
<span
|
|
45
|
+
style={{
|
|
46
|
+
color: colors.textTertiary,
|
|
47
|
+
fontSize: '13px',
|
|
48
|
+
fontWeight: '500',
|
|
49
|
+
fontFamily: fonts.body,
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
OR
|
|
53
|
+
</span>
|
|
54
|
+
<input
|
|
55
|
+
type="text"
|
|
56
|
+
placeholder="Enter file path (e.g., ~/.cursor/mcp.json)"
|
|
57
|
+
value={filePath}
|
|
58
|
+
onChange={onPathChange}
|
|
59
|
+
style={{
|
|
60
|
+
flex: 1,
|
|
61
|
+
padding: '8px 12px',
|
|
62
|
+
background: colors.bgCard,
|
|
63
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
64
|
+
color: colors.textPrimary,
|
|
65
|
+
fontSize: '13px',
|
|
66
|
+
borderRadius: '8px',
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
{fileContent && !filePath && (
|
|
71
|
+
<div>
|
|
72
|
+
<label
|
|
73
|
+
style={{
|
|
74
|
+
display: 'block',
|
|
75
|
+
fontSize: '12px',
|
|
76
|
+
color: colors.textSecondary,
|
|
77
|
+
marginBottom: '6px',
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
Optional: File Path to Update
|
|
81
|
+
</label>
|
|
82
|
+
<input
|
|
83
|
+
type="text"
|
|
84
|
+
placeholder="Enter file path to update (e.g., ~/.cursor/mcp.json)"
|
|
85
|
+
value={updatePath}
|
|
86
|
+
onChange={onUpdatePathChange}
|
|
87
|
+
style={{
|
|
88
|
+
width: '100%',
|
|
89
|
+
padding: '8px 12px',
|
|
90
|
+
background: colors.bgCard,
|
|
91
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
92
|
+
color: colors.textPrimary,
|
|
93
|
+
fontSize: '13px',
|
|
94
|
+
borderRadius: '8px',
|
|
95
|
+
}}
|
|
96
|
+
/>
|
|
97
|
+
<div
|
|
98
|
+
style={{
|
|
99
|
+
fontSize: '12px',
|
|
100
|
+
color: colors.textSecondary,
|
|
101
|
+
marginTop: '6px',
|
|
102
|
+
fontFamily: fonts.body,
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
Provide the file path if you want to update the original config file (backup will be
|
|
106
|
+
created)
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
{fileContent && (
|
|
111
|
+
<div style={{ marginTop: '8px' }}>
|
|
112
|
+
<div
|
|
113
|
+
style={{
|
|
114
|
+
color: colors.textSecondary,
|
|
115
|
+
fontSize: '12px',
|
|
116
|
+
marginBottom: '6px',
|
|
117
|
+
fontWeight: '500',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
File Content Preview
|
|
121
|
+
</div>
|
|
122
|
+
<pre
|
|
123
|
+
style={{
|
|
124
|
+
background: colors.bgCard,
|
|
125
|
+
padding: '12px',
|
|
126
|
+
borderRadius: '8px',
|
|
127
|
+
fontSize: '12px',
|
|
128
|
+
fontFamily: 'monospace',
|
|
129
|
+
color: colors.textPrimary,
|
|
130
|
+
maxHeight: '200px',
|
|
131
|
+
overflow: 'auto',
|
|
132
|
+
border: `1px solid ${colors.borderLight}`,
|
|
133
|
+
lineHeight: '1.5',
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
{fileContent}
|
|
137
|
+
</pre>
|
|
138
|
+
</div>
|
|
139
|
+
)}
|
|
140
|
+
</>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default FileInput;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
|
|
3
|
+
const ChevronDown = ({ size = 12, color = 'currentColor' }) => (
|
|
4
|
+
<svg
|
|
5
|
+
width={size}
|
|
6
|
+
height={size}
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke={color}
|
|
10
|
+
strokeWidth="2.5"
|
|
11
|
+
strokeLinecap="round"
|
|
12
|
+
strokeLinejoin="round"
|
|
13
|
+
style={{ display: 'inline-block', verticalAlign: 'middle' }}
|
|
14
|
+
>
|
|
15
|
+
<polyline points="6 9 12 15 18 9" />
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const ChevronRight = ({ size = 12, color = 'currentColor' }) => (
|
|
20
|
+
<svg
|
|
21
|
+
width={size}
|
|
22
|
+
height={size}
|
|
23
|
+
viewBox="0 0 24 24"
|
|
24
|
+
fill="none"
|
|
25
|
+
stroke={color}
|
|
26
|
+
strokeWidth="2.5"
|
|
27
|
+
strokeLinecap="round"
|
|
28
|
+
strokeLinejoin="round"
|
|
29
|
+
style={{ display: 'inline-block', verticalAlign: 'middle' }}
|
|
30
|
+
>
|
|
31
|
+
<polyline points="9 18 15 12 9 6" />
|
|
32
|
+
</svg>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default function GroupHeader({ children, onClick, isExpanded, indent = 0 }) {
|
|
36
|
+
return (
|
|
37
|
+
<tr
|
|
38
|
+
onClick={onClick}
|
|
39
|
+
style={{
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
background: colors.bgSecondary,
|
|
42
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
43
|
+
borderTop: `1px solid ${colors.borderLight}`,
|
|
44
|
+
}}
|
|
45
|
+
onMouseEnter={(e) => {
|
|
46
|
+
e.currentTarget.style.background = colors.bgCard;
|
|
47
|
+
}}
|
|
48
|
+
onMouseLeave={(e) => {
|
|
49
|
+
e.currentTarget.style.background = colors.bgSecondary;
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<td
|
|
53
|
+
colSpan={11}
|
|
54
|
+
style={{
|
|
55
|
+
padding: indent > 0 ? '12px 16px 12px 40px' : '12px 16px',
|
|
56
|
+
color: colors.textPrimary,
|
|
57
|
+
fontFamily: fonts.body,
|
|
58
|
+
fontWeight: '600',
|
|
59
|
+
fontSize: indent > 0 ? '11px' : '12px',
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<span
|
|
63
|
+
style={{
|
|
64
|
+
marginRight: '8px',
|
|
65
|
+
userSelect: 'none',
|
|
66
|
+
display: 'inline-flex',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{isExpanded ? <ChevronDown size={12} /> : <ChevronRight size={12} />}
|
|
71
|
+
</span>
|
|
72
|
+
{children}
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
);
|
|
76
|
+
}
|