@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,117 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import { ChevronLeft, ChevronRight } from './TourTooltipIcons';
|
|
3
|
+
|
|
4
|
+
export default function TourTooltipButtons({
|
|
5
|
+
currentStep,
|
|
6
|
+
totalSteps,
|
|
7
|
+
onNext,
|
|
8
|
+
onPrevious,
|
|
9
|
+
onSkip,
|
|
10
|
+
}) {
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
style={{
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'space-between',
|
|
17
|
+
gap: '12px',
|
|
18
|
+
pointerEvents: 'none',
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<button
|
|
22
|
+
onClick={(e) => {
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
onSkip();
|
|
25
|
+
}}
|
|
26
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
27
|
+
style={{
|
|
28
|
+
background: 'transparent',
|
|
29
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
30
|
+
color: colors.textSecondary,
|
|
31
|
+
padding: '8px 16px',
|
|
32
|
+
borderRadius: '8px',
|
|
33
|
+
cursor: 'pointer',
|
|
34
|
+
fontSize: '13px',
|
|
35
|
+
fontFamily: fonts.body,
|
|
36
|
+
flex: 1,
|
|
37
|
+
pointerEvents: 'auto',
|
|
38
|
+
}}
|
|
39
|
+
onMouseEnter={(e) => {
|
|
40
|
+
e.currentTarget.style.background = colors.bgHover;
|
|
41
|
+
e.currentTarget.style.color = colors.textPrimary;
|
|
42
|
+
e.currentTarget.style.borderColor = colors.borderMedium;
|
|
43
|
+
}}
|
|
44
|
+
onMouseLeave={(e) => {
|
|
45
|
+
e.currentTarget.style.background = 'transparent';
|
|
46
|
+
e.currentTarget.style.color = colors.textSecondary;
|
|
47
|
+
e.currentTarget.style.borderColor = colors.borderMedium;
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
Skip Tour
|
|
51
|
+
</button>
|
|
52
|
+
<div style={{ display: 'flex', gap: '8px', pointerEvents: 'auto' }}>
|
|
53
|
+
{currentStep > 0 && (
|
|
54
|
+
<button
|
|
55
|
+
onClick={(e) => {
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
onPrevious();
|
|
58
|
+
}}
|
|
59
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
60
|
+
style={{
|
|
61
|
+
background: colors.buttonSecondary,
|
|
62
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
63
|
+
color: colors.textPrimary,
|
|
64
|
+
padding: '8px 12px',
|
|
65
|
+
borderRadius: '8px',
|
|
66
|
+
cursor: 'pointer',
|
|
67
|
+
fontSize: '13px',
|
|
68
|
+
fontFamily: fonts.body,
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
gap: '4px',
|
|
72
|
+
}}
|
|
73
|
+
onMouseEnter={(e) => {
|
|
74
|
+
e.currentTarget.style.background = colors.buttonSecondaryHover;
|
|
75
|
+
}}
|
|
76
|
+
onMouseLeave={(e) => {
|
|
77
|
+
e.currentTarget.style.background = colors.buttonSecondary;
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<ChevronLeft size={14} />
|
|
81
|
+
Previous
|
|
82
|
+
</button>
|
|
83
|
+
)}
|
|
84
|
+
<button
|
|
85
|
+
onClick={(e) => {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
onNext();
|
|
88
|
+
}}
|
|
89
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
90
|
+
style={{
|
|
91
|
+
background: colors.buttonPrimary,
|
|
92
|
+
border: 'none',
|
|
93
|
+
color: colors.textInverse,
|
|
94
|
+
padding: '8px 16px',
|
|
95
|
+
borderRadius: '8px',
|
|
96
|
+
cursor: 'pointer',
|
|
97
|
+
fontSize: '13px',
|
|
98
|
+
fontFamily: fonts.body,
|
|
99
|
+
display: 'flex',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
gap: '4px',
|
|
102
|
+
fontWeight: '500',
|
|
103
|
+
}}
|
|
104
|
+
onMouseEnter={(e) => {
|
|
105
|
+
e.currentTarget.style.background = colors.buttonPrimaryHover;
|
|
106
|
+
}}
|
|
107
|
+
onMouseLeave={(e) => {
|
|
108
|
+
e.currentTarget.style.background = colors.buttonPrimary;
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{currentStep === totalSteps - 1 ? 'Finish' : 'Next'}
|
|
112
|
+
{currentStep < totalSteps - 1 && <ChevronRight size={14} />}
|
|
113
|
+
</button>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import { CloseIcon } from './TourTooltipIcons';
|
|
3
|
+
|
|
4
|
+
export default function TourTooltipHeader({ step, currentStep, totalSteps, isDragging, onSkip }) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
style={{
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'flex-start',
|
|
10
|
+
justifyContent: 'space-between',
|
|
11
|
+
marginBottom: '12px',
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
<div style={{ flex: 1, pointerEvents: 'none' }}>
|
|
15
|
+
<h3
|
|
16
|
+
style={{
|
|
17
|
+
margin: 0,
|
|
18
|
+
color: colors.accentBlue,
|
|
19
|
+
fontSize: '16px',
|
|
20
|
+
fontWeight: '600',
|
|
21
|
+
fontFamily: fonts.body,
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
{step.title}
|
|
25
|
+
</h3>
|
|
26
|
+
<p
|
|
27
|
+
style={{
|
|
28
|
+
margin: '4px 0 0 0',
|
|
29
|
+
color: colors.textTertiary,
|
|
30
|
+
fontSize: '12px',
|
|
31
|
+
fontFamily: fonts.body,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
Step {currentStep + 1} of {totalSteps}
|
|
35
|
+
{isDragging && <span style={{ marginLeft: '8px', fontSize: '11px' }}>• Dragging</span>}
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
<button
|
|
39
|
+
onClick={(e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
onSkip();
|
|
42
|
+
}}
|
|
43
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
44
|
+
style={{
|
|
45
|
+
background: 'transparent',
|
|
46
|
+
border: 'none',
|
|
47
|
+
color: colors.textTertiary,
|
|
48
|
+
cursor: 'pointer',
|
|
49
|
+
padding: '4px',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
borderRadius: '8px',
|
|
53
|
+
marginLeft: '12px',
|
|
54
|
+
pointerEvents: 'auto',
|
|
55
|
+
}}
|
|
56
|
+
onMouseEnter={(e) => {
|
|
57
|
+
e.currentTarget.style.background = colors.bgHover;
|
|
58
|
+
e.currentTarget.style.color = colors.textPrimary;
|
|
59
|
+
}}
|
|
60
|
+
onMouseLeave={(e) => {
|
|
61
|
+
e.currentTarget.style.background = 'transparent';
|
|
62
|
+
e.currentTarget.style.color = colors.textTertiary;
|
|
63
|
+
}}
|
|
64
|
+
title="Skip tour"
|
|
65
|
+
>
|
|
66
|
+
<CloseIcon size={18} />
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const CloseIcon = ({ size = 16, color = 'currentColor' }) => (
|
|
2
|
+
<svg
|
|
3
|
+
width={size}
|
|
4
|
+
height={size}
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
fill="none"
|
|
7
|
+
stroke={color}
|
|
8
|
+
strokeWidth="2"
|
|
9
|
+
strokeLinecap="round"
|
|
10
|
+
strokeLinejoin="round"
|
|
11
|
+
>
|
|
12
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
13
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const ChevronRight = ({ size = 16, color = 'currentColor' }) => (
|
|
18
|
+
<svg
|
|
19
|
+
width={size}
|
|
20
|
+
height={size}
|
|
21
|
+
viewBox="0 0 24 24"
|
|
22
|
+
fill="none"
|
|
23
|
+
stroke={color}
|
|
24
|
+
strokeWidth="2"
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
strokeLinejoin="round"
|
|
27
|
+
>
|
|
28
|
+
<polyline points="9 18 15 12 9 6" />
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const ChevronLeft = ({ size = 16, color = 'currentColor' }) => (
|
|
33
|
+
<svg
|
|
34
|
+
width={size}
|
|
35
|
+
height={size}
|
|
36
|
+
viewBox="0 0 24 24"
|
|
37
|
+
fill="none"
|
|
38
|
+
stroke={color}
|
|
39
|
+
strokeWidth="2"
|
|
40
|
+
strokeLinecap="round"
|
|
41
|
+
strokeLinejoin="round"
|
|
42
|
+
>
|
|
43
|
+
<polyline points="15 18 9 12 15 6" />
|
|
44
|
+
</svg>
|
|
45
|
+
);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
export function useTooltipPosition(elementRect, step, currentStep) {
|
|
4
|
+
const [tooltipPosition, setTooltipPosition] = useState({ x: 0, y: 0 });
|
|
5
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
6
|
+
const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setTooltipPosition({ x: 0, y: 0 });
|
|
10
|
+
}, [currentStep]);
|
|
11
|
+
|
|
12
|
+
const handleMouseDown = (e, tooltipRef) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
if (tooltipRef.current) {
|
|
16
|
+
const rect = tooltipRef.current.getBoundingClientRect();
|
|
17
|
+
setDragOffset({
|
|
18
|
+
x: e.clientX - rect.left,
|
|
19
|
+
y: e.clientY - rect.top,
|
|
20
|
+
});
|
|
21
|
+
setIsDragging(true);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isDragging) return;
|
|
27
|
+
|
|
28
|
+
const handleMouseMove = (e) => {
|
|
29
|
+
setTooltipPosition({
|
|
30
|
+
x: e.clientX - dragOffset.x,
|
|
31
|
+
y: e.clientY - dragOffset.y,
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const handleMouseUp = () => {
|
|
36
|
+
setIsDragging(false);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
window.addEventListener('mousemove', handleMouseMove);
|
|
40
|
+
window.addEventListener('mouseup', handleMouseUp);
|
|
41
|
+
|
|
42
|
+
return () => {
|
|
43
|
+
window.removeEventListener('mousemove', handleMouseMove);
|
|
44
|
+
window.removeEventListener('mouseup', handleMouseUp);
|
|
45
|
+
};
|
|
46
|
+
}, [isDragging, dragOffset]);
|
|
47
|
+
|
|
48
|
+
const calculatePosition = () => {
|
|
49
|
+
if (!elementRect) return { left: 0, top: 0, transform: 'none' };
|
|
50
|
+
|
|
51
|
+
const tooltipWidth = 350;
|
|
52
|
+
const tooltipHeight = 200;
|
|
53
|
+
const spacing = 20;
|
|
54
|
+
|
|
55
|
+
if (tooltipPosition.x !== 0 || tooltipPosition.y !== 0) {
|
|
56
|
+
const left = Math.max(10, Math.min(tooltipPosition.x, window.innerWidth - tooltipWidth - 10));
|
|
57
|
+
const top = Math.max(
|
|
58
|
+
10,
|
|
59
|
+
Math.min(tooltipPosition.y, window.innerHeight - tooltipHeight - 10)
|
|
60
|
+
);
|
|
61
|
+
return { left, top, transform: 'none' };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const position = step.position || 'bottom';
|
|
65
|
+
let left, top, transform;
|
|
66
|
+
|
|
67
|
+
if (position === 'left') {
|
|
68
|
+
left = elementRect.left - tooltipWidth - spacing;
|
|
69
|
+
top = elementRect.top + elementRect.height / 2;
|
|
70
|
+
transform = 'translateY(-50%)';
|
|
71
|
+
if (left < 10) {
|
|
72
|
+
left = elementRect.right + spacing;
|
|
73
|
+
}
|
|
74
|
+
} else if (position === 'right') {
|
|
75
|
+
left = elementRect.right + spacing;
|
|
76
|
+
top = elementRect.top + elementRect.height / 2;
|
|
77
|
+
transform = 'translateY(-50%)';
|
|
78
|
+
if (left + tooltipWidth > window.innerWidth - 10) {
|
|
79
|
+
left = elementRect.left - tooltipWidth - spacing;
|
|
80
|
+
}
|
|
81
|
+
} else if (position === 'top') {
|
|
82
|
+
left = elementRect.left + elementRect.width / 2;
|
|
83
|
+
top = elementRect.top - tooltipHeight - spacing;
|
|
84
|
+
transform = 'translate(-50%, 0)';
|
|
85
|
+
if (top < 10) {
|
|
86
|
+
top = elementRect.bottom + spacing;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
left = elementRect.left + elementRect.width / 2;
|
|
90
|
+
top = elementRect.bottom + spacing;
|
|
91
|
+
transform = 'translate(-50%, 0)';
|
|
92
|
+
if (top + tooltipHeight > window.innerHeight - 10) {
|
|
93
|
+
top = elementRect.top - tooltipHeight - spacing;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
left = Math.max(10, Math.min(left, window.innerWidth - tooltipWidth - 10));
|
|
98
|
+
top = Math.max(10, Math.min(top, window.innerHeight - tooltipHeight - 10));
|
|
99
|
+
|
|
100
|
+
return { left, top, transform };
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
position: calculatePosition(),
|
|
105
|
+
isDragging,
|
|
106
|
+
handleMouseDown,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { colors, fonts } from '../theme';
|
|
3
|
+
import TourTooltipHeader from './TourTooltip/TourTooltipHeader';
|
|
4
|
+
import TourTooltipButtons from './TourTooltip/TourTooltipButtons';
|
|
5
|
+
import { useTooltipPosition } from './TourTooltip/useTooltipPosition';
|
|
6
|
+
|
|
7
|
+
function TourTooltip({ elementRect, step, currentStep, totalSteps, onNext, onPrevious, onSkip }) {
|
|
8
|
+
const tooltipRef = useRef(null);
|
|
9
|
+
const { position, isDragging, handleMouseDown } = useTooltipPosition(
|
|
10
|
+
elementRect,
|
|
11
|
+
step,
|
|
12
|
+
currentStep
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
if (!elementRect) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
ref={tooltipRef}
|
|
22
|
+
onMouseDown={(e) => handleMouseDown(e, tooltipRef)}
|
|
23
|
+
style={{
|
|
24
|
+
position: 'fixed',
|
|
25
|
+
left: `${position.left}px`,
|
|
26
|
+
top: `${position.top}px`,
|
|
27
|
+
transform: position.transform,
|
|
28
|
+
background: colors.bgCard,
|
|
29
|
+
border: `2px solid ${colors.accentBlue}`,
|
|
30
|
+
borderRadius: '12px',
|
|
31
|
+
padding: '20px',
|
|
32
|
+
maxWidth: '350px',
|
|
33
|
+
minWidth: '300px',
|
|
34
|
+
boxShadow: `0 4px 20px ${colors.shadowLg}`,
|
|
35
|
+
zIndex: 10001,
|
|
36
|
+
pointerEvents: 'auto',
|
|
37
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
38
|
+
userSelect: 'none',
|
|
39
|
+
}}
|
|
40
|
+
onClick={(e) => {
|
|
41
|
+
const target = e.target;
|
|
42
|
+
if (
|
|
43
|
+
target.tagName !== 'BUTTON' &&
|
|
44
|
+
target.tagName !== 'INPUT' &&
|
|
45
|
+
!target.closest('button')
|
|
46
|
+
) {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
}
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<TourTooltipHeader
|
|
52
|
+
step={step}
|
|
53
|
+
currentStep={currentStep}
|
|
54
|
+
totalSteps={totalSteps}
|
|
55
|
+
isDragging={isDragging}
|
|
56
|
+
onSkip={onSkip}
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
color: colors.textPrimary,
|
|
62
|
+
fontSize: '14px',
|
|
63
|
+
lineHeight: '1.6',
|
|
64
|
+
marginBottom: '20px',
|
|
65
|
+
pointerEvents: 'none',
|
|
66
|
+
fontFamily: fonts.body,
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
{step.content}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<TourTooltipButtons
|
|
73
|
+
currentStep={currentStep}
|
|
74
|
+
totalSteps={totalSteps}
|
|
75
|
+
onNext={onNext}
|
|
76
|
+
onPrevious={onPrevious}
|
|
77
|
+
onSkip={onSkip}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default TourTooltip;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
import { IconList, IconNetwork } from '@tabler/icons-react';
|
|
3
|
+
|
|
4
|
+
function ViewModeTabs({ viewMode, onViewModeChange }) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
data-tour="view-modes"
|
|
8
|
+
style={{
|
|
9
|
+
display: 'flex',
|
|
10
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
11
|
+
background: colors.bgSecondary,
|
|
12
|
+
padding: '0 12px',
|
|
13
|
+
boxShadow: `0 1px 3px ${colors.shadowSm}`,
|
|
14
|
+
flexShrink: 0,
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<button
|
|
18
|
+
onClick={() => onViewModeChange('general')}
|
|
19
|
+
style={{
|
|
20
|
+
padding: '10px 18px',
|
|
21
|
+
background: viewMode === 'general' ? colors.bgCard : 'transparent',
|
|
22
|
+
fontFamily: fonts.body,
|
|
23
|
+
border: 'none',
|
|
24
|
+
borderBottom:
|
|
25
|
+
viewMode === 'general' ? `2px solid ${colors.accentBlue}` : '2px solid transparent',
|
|
26
|
+
color: viewMode === 'general' ? colors.textPrimary : colors.textSecondary,
|
|
27
|
+
borderRadius: '8px 8px 0 0',
|
|
28
|
+
cursor: 'pointer',
|
|
29
|
+
fontSize: '12px',
|
|
30
|
+
fontWeight: viewMode === 'general' ? '500' : 'normal',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
gap: '6px',
|
|
34
|
+
}}
|
|
35
|
+
onMouseEnter={(e) => {
|
|
36
|
+
if (viewMode !== 'general') {
|
|
37
|
+
e.currentTarget.style.background = colors.bgHover;
|
|
38
|
+
e.currentTarget.style.color = colors.textPrimary;
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
onMouseLeave={(e) => {
|
|
42
|
+
if (viewMode !== 'general') {
|
|
43
|
+
e.currentTarget.style.background = 'transparent';
|
|
44
|
+
e.currentTarget.style.color = colors.textSecondary;
|
|
45
|
+
}
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<IconList size={16} stroke={1.5} />
|
|
49
|
+
General List
|
|
50
|
+
</button>
|
|
51
|
+
<button
|
|
52
|
+
onClick={() => onViewModeChange('groupedByMcp')}
|
|
53
|
+
style={{
|
|
54
|
+
padding: '10px 18px',
|
|
55
|
+
background: viewMode === 'groupedByMcp' ? colors.bgCard : 'transparent',
|
|
56
|
+
fontFamily: fonts.body,
|
|
57
|
+
border: 'none',
|
|
58
|
+
borderBottom:
|
|
59
|
+
viewMode === 'groupedByMcp'
|
|
60
|
+
? `2px solid ${colors.accentBlue}`
|
|
61
|
+
: '2px solid transparent',
|
|
62
|
+
color: viewMode === 'groupedByMcp' ? colors.textPrimary : colors.textSecondary,
|
|
63
|
+
cursor: 'pointer',
|
|
64
|
+
fontSize: '12px',
|
|
65
|
+
fontWeight: viewMode === 'groupedByMcp' ? '500' : 'normal',
|
|
66
|
+
borderRadius: '8px 8px 0 0',
|
|
67
|
+
display: 'flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
gap: '6px',
|
|
70
|
+
}}
|
|
71
|
+
onMouseEnter={(e) => {
|
|
72
|
+
if (viewMode !== 'groupedByMcp') {
|
|
73
|
+
e.currentTarget.style.background = colors.bgHover;
|
|
74
|
+
e.currentTarget.style.color = colors.textPrimary;
|
|
75
|
+
}
|
|
76
|
+
}}
|
|
77
|
+
onMouseLeave={(e) => {
|
|
78
|
+
if (viewMode !== 'groupedByMcp') {
|
|
79
|
+
e.currentTarget.style.background = 'transparent';
|
|
80
|
+
e.currentTarget.style.color = colors.textSecondary;
|
|
81
|
+
}
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<IconNetwork size={16} stroke={1.5} />
|
|
85
|
+
MCP Protocol View
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default ViewModeTabs;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
|
|
3
|
+
export default function WhatThisDoesSection({ filePath, updatePath }) {
|
|
4
|
+
return (
|
|
5
|
+
<div
|
|
6
|
+
style={{
|
|
7
|
+
background: colors.bgCard,
|
|
8
|
+
border: `1px solid ${colors.borderLight}`,
|
|
9
|
+
borderRadius: '12px',
|
|
10
|
+
padding: '24px',
|
|
11
|
+
boxShadow: `0 2px 4px ${colors.shadowSm}`,
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
<h3
|
|
15
|
+
style={{
|
|
16
|
+
fontSize: '15px',
|
|
17
|
+
fontWeight: '600',
|
|
18
|
+
marginBottom: '12px',
|
|
19
|
+
color: colors.textPrimary,
|
|
20
|
+
fontFamily: fonts.body,
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
What This Does
|
|
24
|
+
</h3>
|
|
25
|
+
<ul
|
|
26
|
+
style={{
|
|
27
|
+
margin: 0,
|
|
28
|
+
paddingLeft: '20px',
|
|
29
|
+
fontSize: '13px',
|
|
30
|
+
color: colors.textSecondary,
|
|
31
|
+
lineHeight: '1.8',
|
|
32
|
+
fontFamily: fonts.body,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<li>
|
|
36
|
+
Converts your MCP config (
|
|
37
|
+
<code style={{ color: colors.accentOrange, fontFamily: fonts.mono }}>mcpServers</code>) to
|
|
38
|
+
MCP Shark format (
|
|
39
|
+
<code style={{ color: colors.accentOrange, fontFamily: fonts.mono }}>servers</code>)
|
|
40
|
+
</li>
|
|
41
|
+
<li>
|
|
42
|
+
Starts the MCP Shark server on{' '}
|
|
43
|
+
<code style={{ color: colors.accentBlue, fontFamily: fonts.mono }}>
|
|
44
|
+
http://localhost:9851/mcp
|
|
45
|
+
</code>
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
{filePath || updatePath
|
|
49
|
+
? 'Updates your original config file to point to the MCP Shark server (creates a backup first)'
|
|
50
|
+
: 'Note: Provide a file path to update your original config file automatically'}
|
|
51
|
+
</li>
|
|
52
|
+
{(filePath || updatePath) && (
|
|
53
|
+
<li style={{ color: colors.success, marginTop: '4px', fontWeight: '500' }}>
|
|
54
|
+
✓ Original config will be automatically restored when you stop the server or close the
|
|
55
|
+
UI
|
|
56
|
+
</li>
|
|
57
|
+
)}
|
|
58
|
+
</ul>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|