@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.
Files changed (212) hide show
  1. package/LICENSE +85 -0
  2. package/README.md +724 -0
  3. package/bin/mcp-shark.js +93 -0
  4. package/mcp-server/.editorconfig +15 -0
  5. package/mcp-server/.prettierignore +11 -0
  6. package/mcp-server/.prettierrc +12 -0
  7. package/mcp-server/README.md +280 -0
  8. package/mcp-server/commitlint.config.cjs +42 -0
  9. package/mcp-server/eslint.config.js +131 -0
  10. package/mcp-server/lib/auditor/audit.js +228 -0
  11. package/mcp-server/lib/common/error.js +15 -0
  12. package/mcp-server/lib/server/external/all.js +32 -0
  13. package/mcp-server/lib/server/external/config.js +59 -0
  14. package/mcp-server/lib/server/external/kv.js +102 -0
  15. package/mcp-server/lib/server/external/single/client.js +35 -0
  16. package/mcp-server/lib/server/external/single/request.js +49 -0
  17. package/mcp-server/lib/server/external/single/run.js +75 -0
  18. package/mcp-server/lib/server/external/single/transport.js +57 -0
  19. package/mcp-server/lib/server/internal/handlers/common.js +20 -0
  20. package/mcp-server/lib/server/internal/handlers/error.js +7 -0
  21. package/mcp-server/lib/server/internal/handlers/prompts-get.js +22 -0
  22. package/mcp-server/lib/server/internal/handlers/prompts-list.js +12 -0
  23. package/mcp-server/lib/server/internal/handlers/resources-list.js +12 -0
  24. package/mcp-server/lib/server/internal/handlers/resources-read.js +19 -0
  25. package/mcp-server/lib/server/internal/handlers/tools-call.js +37 -0
  26. package/mcp-server/lib/server/internal/handlers/tools-list.js +14 -0
  27. package/mcp-server/lib/server/internal/run.js +49 -0
  28. package/mcp-server/lib/server/internal/server.js +63 -0
  29. package/mcp-server/lib/server/internal/session.js +39 -0
  30. package/mcp-server/mcp-shark.js +72 -0
  31. package/mcp-server/package-lock.json +4784 -0
  32. package/mcp-server/package.json +30 -0
  33. package/package.json +103 -0
  34. package/ui/README.md +212 -0
  35. package/ui/index.html +16 -0
  36. package/ui/package-lock.json +3574 -0
  37. package/ui/package.json +12 -0
  38. package/ui/paths.js +282 -0
  39. package/ui/public/og-image.png +0 -0
  40. package/ui/server/routes/backups.js +251 -0
  41. package/ui/server/routes/composite.js +244 -0
  42. package/ui/server/routes/config.js +175 -0
  43. package/ui/server/routes/conversations.js +25 -0
  44. package/ui/server/routes/help.js +43 -0
  45. package/ui/server/routes/logs.js +32 -0
  46. package/ui/server/routes/playground.js +152 -0
  47. package/ui/server/routes/requests.js +235 -0
  48. package/ui/server/routes/sessions.js +27 -0
  49. package/ui/server/routes/smartscan/discover.js +117 -0
  50. package/ui/server/routes/smartscan/scans/clearCache.js +22 -0
  51. package/ui/server/routes/smartscan/scans/createBatchScans.js +123 -0
  52. package/ui/server/routes/smartscan/scans/createScan.js +42 -0
  53. package/ui/server/routes/smartscan/scans/getCachedResults.js +51 -0
  54. package/ui/server/routes/smartscan/scans/getScan.js +41 -0
  55. package/ui/server/routes/smartscan/scans/listScans.js +24 -0
  56. package/ui/server/routes/smartscan/scans.js +13 -0
  57. package/ui/server/routes/smartscan/token.js +56 -0
  58. package/ui/server/routes/smartscan/transport.js +53 -0
  59. package/ui/server/routes/smartscan.js +24 -0
  60. package/ui/server/routes/statistics.js +83 -0
  61. package/ui/server/utils/config-update.js +212 -0
  62. package/ui/server/utils/config.js +98 -0
  63. package/ui/server/utils/paths.js +23 -0
  64. package/ui/server/utils/port.js +28 -0
  65. package/ui/server/utils/process.js +80 -0
  66. package/ui/server/utils/scan-cache/all-results.js +180 -0
  67. package/ui/server/utils/scan-cache/directory.js +35 -0
  68. package/ui/server/utils/scan-cache/file-operations.js +104 -0
  69. package/ui/server/utils/scan-cache/hash.js +47 -0
  70. package/ui/server/utils/scan-cache/server-operations.js +80 -0
  71. package/ui/server/utils/scan-cache.js +12 -0
  72. package/ui/server/utils/serialization.js +13 -0
  73. package/ui/server/utils/smartscan-token.js +42 -0
  74. package/ui/server.js +199 -0
  75. package/ui/src/App.jsx +153 -0
  76. package/ui/src/CompositeLogs.jsx +164 -0
  77. package/ui/src/CompositeSetup.jsx +285 -0
  78. package/ui/src/HelpGuide/HelpGuideContent.jsx +118 -0
  79. package/ui/src/HelpGuide/HelpGuideFooter.jsx +58 -0
  80. package/ui/src/HelpGuide/HelpGuideHeader.jsx +56 -0
  81. package/ui/src/HelpGuide.jsx +65 -0
  82. package/ui/src/IntroTour.jsx +140 -0
  83. package/ui/src/LogDetail.jsx +122 -0
  84. package/ui/src/LogTable.jsx +242 -0
  85. package/ui/src/PacketDetail.jsx +190 -0
  86. package/ui/src/PacketFilters.jsx +222 -0
  87. package/ui/src/PacketList.jsx +183 -0
  88. package/ui/src/SmartScan.jsx +178 -0
  89. package/ui/src/TabNavigation.jsx +143 -0
  90. package/ui/src/components/App/HelpButton.jsx +64 -0
  91. package/ui/src/components/App/TrafficTab.jsx +69 -0
  92. package/ui/src/components/App/useAppState.js +163 -0
  93. package/ui/src/components/BackupList.jsx +192 -0
  94. package/ui/src/components/CollapsibleSection.jsx +82 -0
  95. package/ui/src/components/ConfigFileSection.jsx +84 -0
  96. package/ui/src/components/ConfigViewerModal.jsx +141 -0
  97. package/ui/src/components/ConfirmationModal.jsx +129 -0
  98. package/ui/src/components/DetailsTab/BodySection.jsx +27 -0
  99. package/ui/src/components/DetailsTab/CollapsibleRequestResponse.jsx +70 -0
  100. package/ui/src/components/DetailsTab/HeadersSection.jsx +25 -0
  101. package/ui/src/components/DetailsTab/InfoSection.jsx +28 -0
  102. package/ui/src/components/DetailsTab/NetworkInfoSection.jsx +63 -0
  103. package/ui/src/components/DetailsTab/ProtocolInfoSection.jsx +75 -0
  104. package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +46 -0
  105. package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +66 -0
  106. package/ui/src/components/DetailsTab.jsx +31 -0
  107. package/ui/src/components/DetectedPathsList.jsx +171 -0
  108. package/ui/src/components/FileInput.jsx +144 -0
  109. package/ui/src/components/GroupHeader.jsx +76 -0
  110. package/ui/src/components/GroupedByMcpView.jsx +103 -0
  111. package/ui/src/components/GroupedByServerView.jsx +134 -0
  112. package/ui/src/components/GroupedBySessionView.jsx +127 -0
  113. package/ui/src/components/GroupedViews.jsx +2 -0
  114. package/ui/src/components/HexTab.jsx +188 -0
  115. package/ui/src/components/LogsDisplay.jsx +93 -0
  116. package/ui/src/components/LogsToolbar.jsx +193 -0
  117. package/ui/src/components/McpPlayground/LoadingModal.jsx +113 -0
  118. package/ui/src/components/McpPlayground/PromptsSection/PromptCallPanel.jsx +125 -0
  119. package/ui/src/components/McpPlayground/PromptsSection/PromptItem.jsx +48 -0
  120. package/ui/src/components/McpPlayground/PromptsSection/PromptsList.jsx +45 -0
  121. package/ui/src/components/McpPlayground/PromptsSection.jsx +106 -0
  122. package/ui/src/components/McpPlayground/ResourcesSection/ResourceCallPanel.jsx +89 -0
  123. package/ui/src/components/McpPlayground/ResourcesSection/ResourceItem.jsx +59 -0
  124. package/ui/src/components/McpPlayground/ResourcesSection/ResourcesList.jsx +45 -0
  125. package/ui/src/components/McpPlayground/ResourcesSection.jsx +91 -0
  126. package/ui/src/components/McpPlayground/ToolsSection/ToolCallPanel.jsx +125 -0
  127. package/ui/src/components/McpPlayground/ToolsSection/ToolItem.jsx +48 -0
  128. package/ui/src/components/McpPlayground/ToolsSection/ToolsList.jsx +45 -0
  129. package/ui/src/components/McpPlayground/ToolsSection.jsx +107 -0
  130. package/ui/src/components/McpPlayground/common/EmptyState.jsx +17 -0
  131. package/ui/src/components/McpPlayground/common/ErrorState.jsx +17 -0
  132. package/ui/src/components/McpPlayground/common/LoadingState.jsx +17 -0
  133. package/ui/src/components/McpPlayground/useMcpPlayground.js +280 -0
  134. package/ui/src/components/McpPlayground.jsx +171 -0
  135. package/ui/src/components/MessageDisplay.jsx +28 -0
  136. package/ui/src/components/PacketDetailHeader.jsx +88 -0
  137. package/ui/src/components/PacketFilters/ExportControls.jsx +126 -0
  138. package/ui/src/components/PacketFilters/FilterInput.jsx +59 -0
  139. package/ui/src/components/RawTab.jsx +142 -0
  140. package/ui/src/components/RequestRow/OrphanedResponseRow.jsx +155 -0
  141. package/ui/src/components/RequestRow/RequestRowMain.jsx +240 -0
  142. package/ui/src/components/RequestRow/ResponseRow.jsx +158 -0
  143. package/ui/src/components/RequestRow.jsx +70 -0
  144. package/ui/src/components/ServerControl.jsx +133 -0
  145. package/ui/src/components/ServiceSelector.jsx +209 -0
  146. package/ui/src/components/SetupHeader.jsx +30 -0
  147. package/ui/src/components/SharkLogo.jsx +21 -0
  148. package/ui/src/components/SmartScan/AnalysisResult.jsx +64 -0
  149. package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultItem.jsx +215 -0
  150. package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultsHeader.jsx +94 -0
  151. package/ui/src/components/SmartScan/BatchResultsDisplay.jsx +26 -0
  152. package/ui/src/components/SmartScan/DebugInfoSection.jsx +53 -0
  153. package/ui/src/components/SmartScan/EmptyState.jsx +57 -0
  154. package/ui/src/components/SmartScan/ErrorDisplay.jsx +48 -0
  155. package/ui/src/components/SmartScan/ExpandableSection.jsx +93 -0
  156. package/ui/src/components/SmartScan/FindingsTable.jsx +257 -0
  157. package/ui/src/components/SmartScan/ListViewContent.jsx +75 -0
  158. package/ui/src/components/SmartScan/NotablePatternsSection.jsx +75 -0
  159. package/ui/src/components/SmartScan/OverallSummarySection.jsx +72 -0
  160. package/ui/src/components/SmartScan/RawDataSection.jsx +52 -0
  161. package/ui/src/components/SmartScan/RecommendationsSection.jsx +78 -0
  162. package/ui/src/components/SmartScan/ScanDetailHeader.jsx +92 -0
  163. package/ui/src/components/SmartScan/ScanDetailView.jsx +141 -0
  164. package/ui/src/components/SmartScan/ScanListView/ScanListHeader.jsx +49 -0
  165. package/ui/src/components/SmartScan/ScanListView/ScanListItem.jsx +201 -0
  166. package/ui/src/components/SmartScan/ScanListView.jsx +73 -0
  167. package/ui/src/components/SmartScan/ScanOverviewSection.jsx +123 -0
  168. package/ui/src/components/SmartScan/ScanResultsDisplay.jsx +35 -0
  169. package/ui/src/components/SmartScan/ScanViewContent.jsx +68 -0
  170. package/ui/src/components/SmartScan/ScanningProgress.jsx +47 -0
  171. package/ui/src/components/SmartScan/ServerInfoSection.jsx +43 -0
  172. package/ui/src/components/SmartScan/ServerSelectionRow.jsx +207 -0
  173. package/ui/src/components/SmartScan/SingleResultDisplay.jsx +269 -0
  174. package/ui/src/components/SmartScan/SmartScanControls.jsx +290 -0
  175. package/ui/src/components/SmartScan/SmartScanHeader.jsx +77 -0
  176. package/ui/src/components/SmartScan/ViewModeTabs.jsx +57 -0
  177. package/ui/src/components/SmartScan/hooks/useCacheManagement.js +34 -0
  178. package/ui/src/components/SmartScan/hooks/useMcpDiscovery.js +121 -0
  179. package/ui/src/components/SmartScan/hooks/useScanList.js +193 -0
  180. package/ui/src/components/SmartScan/hooks/useScanOperations.js +87 -0
  181. package/ui/src/components/SmartScan/hooks/useServerStatus.js +26 -0
  182. package/ui/src/components/SmartScan/hooks/useTokenManagement.js +53 -0
  183. package/ui/src/components/SmartScan/scanDataUtils.js +98 -0
  184. package/ui/src/components/SmartScan/useSmartScan.js +72 -0
  185. package/ui/src/components/SmartScan/utils.js +19 -0
  186. package/ui/src/components/SmartScanIcons.jsx +58 -0
  187. package/ui/src/components/TabNavigation/DesktopTabs.jsx +111 -0
  188. package/ui/src/components/TabNavigation/MobileDropdown.jsx +140 -0
  189. package/ui/src/components/TabNavigation.jsx +97 -0
  190. package/ui/src/components/TabNavigationIcons.jsx +40 -0
  191. package/ui/src/components/TableHeader.jsx +164 -0
  192. package/ui/src/components/TourOverlay.jsx +117 -0
  193. package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +117 -0
  194. package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +70 -0
  195. package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +45 -0
  196. package/ui/src/components/TourTooltip/useTooltipPosition.js +108 -0
  197. package/ui/src/components/TourTooltip.jsx +83 -0
  198. package/ui/src/components/ViewModeTabs.jsx +91 -0
  199. package/ui/src/components/WhatThisDoesSection.jsx +61 -0
  200. package/ui/src/config/tourSteps.jsx +141 -0
  201. package/ui/src/hooks/useAnimation.js +92 -0
  202. package/ui/src/hooks/useConfigManagement.js +124 -0
  203. package/ui/src/hooks/useServiceExtraction.js +51 -0
  204. package/ui/src/index.css +42 -0
  205. package/ui/src/main.jsx +10 -0
  206. package/ui/src/theme.js +65 -0
  207. package/ui/src/utils/animations.js +170 -0
  208. package/ui/src/utils/groupingUtils.js +93 -0
  209. package/ui/src/utils/hexUtils.js +24 -0
  210. package/ui/src/utils/mcpGroupingUtils.js +262 -0
  211. package/ui/src/utils/requestUtils.js +297 -0
  212. package/ui/vite.config.js +18 -0
@@ -0,0 +1,215 @@
1
+ import { CheckIcon, CacheIcon, ExternalLinkIcon } from '../../SmartScanIcons';
2
+ import { IconEye } from '@tabler/icons-react';
3
+ import { colors, fonts } from '../../../theme';
4
+ import { getRiskLevelColor } from '../utils';
5
+
6
+ export default function BatchResultItem({ result, onViewScan }) {
7
+ // Ensure we have a valid server name
8
+ const serverName =
9
+ result.serverName || result.server_name || result.server?.name || 'Unknown Server';
10
+
11
+ console.log('[BatchResultItem] Rendering with result:', {
12
+ serverName: result.serverName,
13
+ extractedServerName: serverName,
14
+ hasServerName: !!result.serverName,
15
+ resultKeys: Object.keys(result),
16
+ });
17
+
18
+ return (
19
+ <div
20
+ style={{
21
+ background: colors.bgTertiary,
22
+ border: `1px solid ${result.success ? colors.borderLight : colors.error}`,
23
+ borderRadius: '8px',
24
+ padding: '10px 16px',
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ justifyContent: 'space-between',
28
+ gap: '12px',
29
+ }}
30
+ >
31
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px', flex: 1, minWidth: 0 }}>
32
+ <h3
33
+ style={{
34
+ fontSize: '13px',
35
+ fontWeight: '600',
36
+ color: colors.textPrimary,
37
+ fontFamily: fonts.body,
38
+ margin: 0,
39
+ whiteSpace: 'nowrap',
40
+ overflow: 'hidden',
41
+ textOverflow: 'ellipsis',
42
+ }}
43
+ >
44
+ {serverName}
45
+ </h3>
46
+
47
+ {result.success && (
48
+ <>
49
+ {result.data?.data?.overall_risk_level && (
50
+ <span
51
+ style={{
52
+ padding: '4px 10px',
53
+ borderRadius: '6px',
54
+ fontSize: '10px',
55
+ fontWeight: '700',
56
+ fontFamily: fonts.body,
57
+ background: getRiskLevelColor(result.data.data.overall_risk_level),
58
+ color: colors.textInverse,
59
+ whiteSpace: 'nowrap',
60
+ }}
61
+ >
62
+ {result.data.data.overall_risk_level.toLowerCase()} risk
63
+ </span>
64
+ )}
65
+ {onViewScan && result.data && (
66
+ <button
67
+ onClick={() => onViewScan(result.data)}
68
+ style={{
69
+ display: 'inline-flex',
70
+ alignItems: 'center',
71
+ gap: '6px',
72
+ padding: '4px 10px',
73
+ borderRadius: '6px',
74
+ background: colors.buttonPrimary,
75
+ border: 'none',
76
+ color: colors.textInverse,
77
+ cursor: 'pointer',
78
+ transition: 'all 0.2s',
79
+ fontSize: '11px',
80
+ fontWeight: '500',
81
+ fontFamily: fonts.body,
82
+ whiteSpace: 'nowrap',
83
+ }}
84
+ onMouseEnter={(e) => {
85
+ e.currentTarget.style.background = colors.buttonPrimaryHover;
86
+ }}
87
+ onMouseLeave={(e) => {
88
+ e.currentTarget.style.background = colors.buttonPrimary;
89
+ }}
90
+ >
91
+ <IconEye size={12} stroke={1.5} />
92
+ <span>View</span>
93
+ </button>
94
+ )}
95
+ {result.data?.scan_id && (
96
+ <a
97
+ href={`https://smart.mcpshark.sh/scan-results?id=${result.data.scan_id}`}
98
+ target="_blank"
99
+ rel="noopener noreferrer"
100
+ style={{
101
+ display: 'inline-flex',
102
+ alignItems: 'center',
103
+ gap: '6px',
104
+ padding: '4px 10px',
105
+ borderRadius: '6px',
106
+ background: colors.bgSecondary,
107
+ border: `1px solid ${colors.borderLight}`,
108
+ color: colors.accentBlue,
109
+ textDecoration: 'none',
110
+ cursor: 'pointer',
111
+ transition: 'all 0.2s',
112
+ fontSize: '11px',
113
+ fontWeight: '500',
114
+ fontFamily: fonts.body,
115
+ whiteSpace: 'nowrap',
116
+ }}
117
+ onMouseEnter={(e) => {
118
+ e.currentTarget.style.background = colors.bgTertiary;
119
+ e.currentTarget.style.borderColor = colors.accentBlue;
120
+ }}
121
+ onMouseLeave={(e) => {
122
+ e.currentTarget.style.background = colors.bgSecondary;
123
+ e.currentTarget.style.borderColor = colors.borderLight;
124
+ }}
125
+ >
126
+ <span>open</span>
127
+ <ExternalLinkIcon size={12} color={colors.accentBlue} />
128
+ </a>
129
+ )}
130
+ </>
131
+ )}
132
+ </div>
133
+
134
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', flexShrink: 0 }}>
135
+ {result.success ? (
136
+ <>
137
+ {result.cached && (
138
+ <span
139
+ style={{
140
+ padding: '4px 8px',
141
+ borderRadius: '6px',
142
+ fontSize: '10px',
143
+ fontWeight: '600',
144
+ fontFamily: fonts.body,
145
+ background: colors.bgSecondary,
146
+ color: colors.textSecondary,
147
+ border: `1px solid ${colors.borderLight}`,
148
+ display: 'inline-flex',
149
+ alignItems: 'center',
150
+ gap: '4px',
151
+ whiteSpace: 'nowrap',
152
+ }}
153
+ title="This result was retrieved from cache"
154
+ >
155
+ <CacheIcon size={10} color={colors.textSecondary} />
156
+ <span>Cached</span>
157
+ </span>
158
+ )}
159
+ <span
160
+ style={{
161
+ padding: '4px 8px',
162
+ borderRadius: '6px',
163
+ fontSize: '10px',
164
+ fontWeight: '700',
165
+ fontFamily: fonts.body,
166
+ background: colors.accentGreen,
167
+ color: colors.textInverse,
168
+ display: 'inline-flex',
169
+ alignItems: 'center',
170
+ gap: '4px',
171
+ whiteSpace: 'nowrap',
172
+ }}
173
+ >
174
+ <CheckIcon size={10} color={colors.textInverse} />
175
+ <span>Success</span>
176
+ </span>
177
+ </>
178
+ ) : (
179
+ <>
180
+ <span
181
+ style={{
182
+ padding: '4px 8px',
183
+ borderRadius: '6px',
184
+ fontSize: '10px',
185
+ fontWeight: '700',
186
+ fontFamily: fonts.body,
187
+ background: colors.error,
188
+ color: colors.textInverse,
189
+ whiteSpace: 'nowrap',
190
+ }}
191
+ >
192
+ ✗ Failed
193
+ </span>
194
+ {result.error && (
195
+ <span
196
+ style={{
197
+ fontSize: '11px',
198
+ color: colors.error,
199
+ fontFamily: fonts.body,
200
+ whiteSpace: 'nowrap',
201
+ maxWidth: '200px',
202
+ overflow: 'hidden',
203
+ textOverflow: 'ellipsis',
204
+ }}
205
+ title={result.error}
206
+ >
207
+ {result.error}
208
+ </span>
209
+ )}
210
+ </>
211
+ )}
212
+ </div>
213
+ </div>
214
+ );
215
+ }
@@ -0,0 +1,94 @@
1
+ import { CheckIcon, CacheIcon } from '../../SmartScanIcons';
2
+ import { colors, fonts } from '../../../theme';
3
+
4
+ export default function BatchResultsHeader({ scanResults }) {
5
+ const cachedCount = scanResults.filter((r) => r.cached).length;
6
+ const scannedCount = scanResults.filter((r) => r.success && !r.cached).length;
7
+ const allCached = scanResults.every((r) => r.cached);
8
+
9
+ return (
10
+ <div
11
+ style={{
12
+ display: 'flex',
13
+ justifyContent: 'space-between',
14
+ alignItems: 'center',
15
+ marginBottom: '16px',
16
+ }}
17
+ >
18
+ <div>
19
+ <h2
20
+ style={{
21
+ fontSize: '14px',
22
+ fontWeight: '600',
23
+ color: colors.textPrimary,
24
+ fontFamily: fonts.body,
25
+ margin: 0,
26
+ marginBottom: '4px',
27
+ }}
28
+ >
29
+ Scan Results ({scanResults.length} server{scanResults.length !== 1 ? 's' : ''})
30
+ </h2>
31
+ {allCached && (
32
+ <p
33
+ style={{
34
+ fontSize: '12px',
35
+ color: colors.textTertiary,
36
+ fontFamily: fonts.body,
37
+ margin: 0,
38
+ }}
39
+ >
40
+ Showing cached results. Run a new scan to get the latest analysis.
41
+ </p>
42
+ )}
43
+ </div>
44
+ {scanResults.length > 0 && (
45
+ <div
46
+ style={{
47
+ display: 'flex',
48
+ gap: '12px',
49
+ alignItems: 'center',
50
+ fontSize: '13px',
51
+ color: colors.textSecondary,
52
+ fontFamily: fonts.body,
53
+ }}
54
+ >
55
+ {cachedCount > 0 && (
56
+ <span
57
+ style={{
58
+ padding: '6px 10px',
59
+ background: colors.bgTertiary,
60
+ borderRadius: '6px',
61
+ fontSize: '11px',
62
+ fontWeight: '600',
63
+ display: 'inline-flex',
64
+ alignItems: 'center',
65
+ gap: '4px',
66
+ fontFamily: fonts.body,
67
+ }}
68
+ >
69
+ <CacheIcon size={12} color={colors.textSecondary} />
70
+ <span>{cachedCount} cached</span>
71
+ </span>
72
+ )}
73
+ {scannedCount > 0 && (
74
+ <span
75
+ style={{
76
+ padding: '6px 10px',
77
+ background: colors.bgTertiary,
78
+ borderRadius: '6px',
79
+ fontSize: '11px',
80
+ fontWeight: '600',
81
+ display: 'inline-flex',
82
+ alignItems: 'center',
83
+ gap: '4px',
84
+ }}
85
+ >
86
+ <CheckIcon size={12} color={colors.accentGreen} />
87
+ <span>{scannedCount} scanned</span>
88
+ </span>
89
+ )}
90
+ </div>
91
+ )}
92
+ </div>
93
+ );
94
+ }
@@ -0,0 +1,26 @@
1
+ import { colors } from '../../theme';
2
+ import BatchResultsHeader from './BatchResultsDisplay/BatchResultsHeader';
3
+ import BatchResultItem from './BatchResultsDisplay/BatchResultItem';
4
+
5
+ export default function BatchResultsDisplay({ scanResults, onViewScan }) {
6
+ if (scanResults.length === 0) return null;
7
+
8
+ return (
9
+ <div
10
+ style={{
11
+ background: colors.bgCard,
12
+ border: `1px solid ${colors.borderLight}`,
13
+ borderRadius: '8px',
14
+ padding: '20px',
15
+ boxShadow: `0 1px 3px ${colors.shadowSm}`,
16
+ }}
17
+ >
18
+ <BatchResultsHeader scanResults={scanResults} />
19
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
20
+ {scanResults.map((result, idx) => (
21
+ <BatchResultItem key={idx} result={result} onViewScan={onViewScan} />
22
+ ))}
23
+ </div>
24
+ </div>
25
+ );
26
+ }
@@ -0,0 +1,53 @@
1
+ import { colors, fonts } from '../../theme';
2
+
3
+ export default function DebugInfoSection({ scan, scanId, serverName, analysisResult }) {
4
+ return (
5
+ <details style={{ marginBottom: '16px' }}>
6
+ <summary
7
+ style={{
8
+ cursor: 'pointer',
9
+ padding: '8px 12px',
10
+ background: colors.bgTertiary,
11
+ borderRadius: '6px',
12
+ fontSize: '11px',
13
+ fontFamily: fonts.body,
14
+ color: colors.textSecondary,
15
+ border: `1px solid ${colors.borderLight}`,
16
+ userSelect: 'none',
17
+ }}
18
+ onMouseEnter={(e) => {
19
+ e.currentTarget.style.background = colors.bgSecondary;
20
+ e.currentTarget.style.color = colors.textPrimary;
21
+ }}
22
+ onMouseLeave={(e) => {
23
+ e.currentTarget.style.background = colors.bgTertiary;
24
+ e.currentTarget.style.color = colors.textSecondary;
25
+ }}
26
+ >
27
+ Debug Info (click to expand)
28
+ </summary>
29
+ <div
30
+ style={{
31
+ marginTop: '8px',
32
+ padding: '12px',
33
+ background: colors.bgTertiary,
34
+ borderRadius: '6px',
35
+ fontSize: '11px',
36
+ fontFamily: 'monospace',
37
+ border: `1px solid ${colors.borderLight}`,
38
+ }}
39
+ >
40
+ <div style={{ fontSize: '10px', color: colors.textSecondary, lineHeight: '1.6' }}>
41
+ <div>scanId: {scanId ? `"${scanId}"` : 'missing'}</div>
42
+ <div>serverName: "{serverName}"</div>
43
+ <div>analysisResult: {analysisResult ? 'found' : 'missing'}</div>
44
+ <div>has scan.result: {scan.result ? 'yes' : 'no'}</div>
45
+ <div>has scan.data: {scan.data ? 'yes' : 'no'}</div>
46
+ <div>scan keys: {Object.keys(scan || {}).join(', ')}</div>
47
+ {scan.result && <div>scan.result keys: {Object.keys(scan.result || {}).join(', ')}</div>}
48
+ {scan.data && <div>scan.data keys: {Object.keys(scan.data || {}).join(', ')}</div>}
49
+ </div>
50
+ </div>
51
+ </details>
52
+ );
53
+ }
@@ -0,0 +1,57 @@
1
+ import { colors, fonts } from '../../theme';
2
+
3
+ export default function EmptyState() {
4
+ return (
5
+ <div
6
+ style={{
7
+ display: 'flex',
8
+ flexDirection: 'column',
9
+ alignItems: 'center',
10
+ justifyContent: 'center',
11
+ minHeight: '400px',
12
+ textAlign: 'center',
13
+ padding: '40px',
14
+ }}
15
+ >
16
+ <div style={{ marginBottom: '24px', opacity: 0.6 }}>
17
+ <svg
18
+ width={64}
19
+ height={64}
20
+ viewBox="0 0 24 24"
21
+ fill="none"
22
+ stroke={colors.textTertiary}
23
+ strokeWidth="1.5"
24
+ strokeLinecap="round"
25
+ strokeLinejoin="round"
26
+ style={{ opacity: 0.5 }}
27
+ >
28
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
29
+ <path d="M9 12l2 2 4-4" />
30
+ </svg>
31
+ </div>
32
+ <h3
33
+ style={{
34
+ fontSize: '20px',
35
+ fontWeight: '600',
36
+ color: colors.textPrimary,
37
+ fontFamily: fonts.body,
38
+ marginBottom: '8px',
39
+ }}
40
+ >
41
+ Ready to Scan
42
+ </h3>
43
+ <p
44
+ style={{
45
+ fontSize: '14px',
46
+ color: colors.textSecondary,
47
+ fontFamily: fonts.body,
48
+ maxWidth: '400px',
49
+ lineHeight: '1.6',
50
+ }}
51
+ >
52
+ Configure your API token and discover MCP servers to start security scanning. Results will
53
+ appear here.
54
+ </p>
55
+ </div>
56
+ );
57
+ }
@@ -0,0 +1,48 @@
1
+ import { AlertIcon } from '../SmartScanIcons';
2
+ import { colors, fonts } from '../../theme';
3
+
4
+ export default function ErrorDisplay({ error }) {
5
+ if (!error) return null;
6
+
7
+ return (
8
+ <div
9
+ style={{
10
+ background: colors.bgCard,
11
+ border: `1px solid ${colors.error}`,
12
+ borderRadius: '12px',
13
+ padding: '16px 20px',
14
+ marginBottom: '24px',
15
+ display: 'flex',
16
+ gap: '12px',
17
+ alignItems: 'flex-start',
18
+ }}
19
+ >
20
+ <AlertIcon size={20} color={colors.error} style={{ flexShrink: 0, marginTop: '2px' }} />
21
+ <div style={{ flex: 1 }}>
22
+ <p
23
+ style={{
24
+ fontSize: '14px',
25
+ color: colors.error,
26
+ fontFamily: fonts.body,
27
+ margin: 0,
28
+ fontWeight: '600',
29
+ marginBottom: '4px',
30
+ }}
31
+ >
32
+ Error
33
+ </p>
34
+ <p
35
+ style={{
36
+ fontSize: '13px',
37
+ color: colors.textSecondary,
38
+ fontFamily: fonts.body,
39
+ margin: 0,
40
+ lineHeight: '1.5',
41
+ }}
42
+ >
43
+ {error}
44
+ </p>
45
+ </div>
46
+ </div>
47
+ );
48
+ }
@@ -0,0 +1,93 @@
1
+ import { useState } from 'react';
2
+ import { colors, fonts } from '../../theme';
3
+
4
+ export default function ExpandableSection({ title, count, children, defaultExpanded = false }) {
5
+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);
6
+
7
+ return (
8
+ <div
9
+ style={{
10
+ background: colors.bgTertiary,
11
+ borderRadius: '8px',
12
+ border: `1px solid ${colors.borderLight}`,
13
+ overflow: 'hidden',
14
+ }}
15
+ >
16
+ <button
17
+ onClick={() => setIsExpanded(!isExpanded)}
18
+ style={{
19
+ width: '100%',
20
+ padding: '8px 12px',
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ justifyContent: 'space-between',
24
+ background: 'transparent',
25
+ border: 'none',
26
+ cursor: 'pointer',
27
+ fontFamily: fonts.body,
28
+ transition: 'background 0.15s',
29
+ }}
30
+ onMouseEnter={(e) => {
31
+ e.currentTarget.style.background = colors.bgCard;
32
+ }}
33
+ onMouseLeave={(e) => {
34
+ e.currentTarget.style.background = 'transparent';
35
+ }}
36
+ >
37
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
38
+ <span
39
+ style={{
40
+ fontSize: '12px',
41
+ fontWeight: '600',
42
+ color: colors.textPrimary,
43
+ fontFamily: fonts.body,
44
+ }}
45
+ >
46
+ {title}
47
+ </span>
48
+ {count !== undefined && (
49
+ <span
50
+ style={{
51
+ padding: '2px 6px',
52
+ background: colors.bgCard,
53
+ borderRadius: '4px',
54
+ fontSize: '10px',
55
+ fontWeight: '500',
56
+ color: colors.textSecondary,
57
+ border: `1px solid ${colors.borderLight}`,
58
+ fontFamily: fonts.body,
59
+ }}
60
+ >
61
+ {count}
62
+ </span>
63
+ )}
64
+ </div>
65
+ <svg
66
+ style={{
67
+ width: '14px',
68
+ height: '14px',
69
+ color: colors.textSecondary,
70
+ transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
71
+ transition: 'transform 0.15s',
72
+ }}
73
+ fill="none"
74
+ stroke="currentColor"
75
+ viewBox="0 0 24 24"
76
+ >
77
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
78
+ </svg>
79
+ </button>
80
+ {isExpanded && (
81
+ <div
82
+ style={{
83
+ padding: '12px',
84
+ borderTop: `1px solid ${colors.borderLight}`,
85
+ background: colors.bgCard,
86
+ }}
87
+ >
88
+ {children}
89
+ </div>
90
+ )}
91
+ </div>
92
+ );
93
+ }