@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,257 @@
1
+ import { colors, fonts } from '../../theme';
2
+ import { getRiskLevelColor } from './utils';
3
+
4
+ export default function FindingsTable({ findings, type }) {
5
+ return (
6
+ <div style={{ overflowX: 'auto' }}>
7
+ <table style={{ width: '100%', fontSize: '12px', fontFamily: fonts.body }}>
8
+ <thead>
9
+ <tr
10
+ style={{
11
+ borderBottom: `1px solid ${colors.borderLight}`,
12
+ background: colors.bgTertiary,
13
+ }}
14
+ >
15
+ <th
16
+ style={{
17
+ textAlign: 'left',
18
+ padding: '6px 8px',
19
+ fontSize: '10px',
20
+ fontWeight: '600',
21
+ color: colors.textTertiary,
22
+ textTransform: 'uppercase',
23
+ letterSpacing: '0.05em',
24
+ }}
25
+ >
26
+ Name
27
+ </th>
28
+ <th
29
+ style={{
30
+ textAlign: 'left',
31
+ padding: '6px 8px',
32
+ fontSize: '10px',
33
+ fontWeight: '600',
34
+ color: colors.textTertiary,
35
+ textTransform: 'uppercase',
36
+ letterSpacing: '0.05em',
37
+ }}
38
+ >
39
+ Risk Level
40
+ </th>
41
+ <th
42
+ style={{
43
+ textAlign: 'left',
44
+ padding: '6px 8px',
45
+ fontSize: '10px',
46
+ fontWeight: '600',
47
+ color: colors.textTertiary,
48
+ textTransform: 'uppercase',
49
+ letterSpacing: '0.05em',
50
+ }}
51
+ >
52
+ Risk Score
53
+ </th>
54
+ <th
55
+ style={{
56
+ textAlign: 'left',
57
+ padding: '6px 8px',
58
+ fontSize: '10px',
59
+ fontWeight: '600',
60
+ color: colors.textTertiary,
61
+ textTransform: 'uppercase',
62
+ letterSpacing: '0.05em',
63
+ }}
64
+ >
65
+ Tags
66
+ </th>
67
+ <th
68
+ style={{
69
+ textAlign: 'left',
70
+ padding: '6px 8px',
71
+ fontSize: '10px',
72
+ fontWeight: '600',
73
+ color: colors.textTertiary,
74
+ textTransform: 'uppercase',
75
+ letterSpacing: '0.05em',
76
+ }}
77
+ >
78
+ Reasons
79
+ </th>
80
+ <th
81
+ style={{
82
+ textAlign: 'left',
83
+ padding: '6px 8px',
84
+ fontSize: '10px',
85
+ fontWeight: '600',
86
+ color: colors.textTertiary,
87
+ textTransform: 'uppercase',
88
+ letterSpacing: '0.05em',
89
+ }}
90
+ >
91
+ Safe Use Notes
92
+ </th>
93
+ {type === 'tool' && (
94
+ <th
95
+ style={{
96
+ textAlign: 'left',
97
+ padding: '6px 8px',
98
+ fontSize: '10px',
99
+ fontWeight: '600',
100
+ color: colors.textTertiary,
101
+ textTransform: 'uppercase',
102
+ letterSpacing: '0.05em',
103
+ }}
104
+ >
105
+ Poisoned
106
+ </th>
107
+ )}
108
+ </tr>
109
+ </thead>
110
+ <tbody>
111
+ {findings.map((finding, index) => (
112
+ <tr
113
+ key={index}
114
+ style={{
115
+ borderBottom: `1px solid ${colors.borderLight}`,
116
+ transition: 'background 0.15s',
117
+ }}
118
+ onMouseEnter={(e) => {
119
+ e.currentTarget.style.background = colors.bgTertiary;
120
+ }}
121
+ onMouseLeave={(e) => {
122
+ e.currentTarget.style.background = 'transparent';
123
+ }}
124
+ >
125
+ <td
126
+ style={{
127
+ padding: '8px',
128
+ fontSize: '12px',
129
+ color: colors.textPrimary,
130
+ fontWeight: '500',
131
+ fontFamily: fonts.body,
132
+ }}
133
+ >
134
+ {finding.name}
135
+ </td>
136
+ <td style={{ padding: '8px' }}>
137
+ <span
138
+ style={{
139
+ display: 'inline-flex',
140
+ alignItems: 'center',
141
+ padding: '2px 6px',
142
+ borderRadius: '4px',
143
+ fontSize: '10px',
144
+ fontWeight: '700',
145
+ color: colors.textInverse,
146
+ background: getRiskLevelColor(finding.risk_level),
147
+ fontFamily: fonts.body,
148
+ }}
149
+ >
150
+ {finding.risk_level?.toUpperCase()}
151
+ </span>
152
+ </td>
153
+ <td
154
+ style={{
155
+ padding: '8px',
156
+ fontSize: '12px',
157
+ color: colors.textSecondary,
158
+ fontFamily: fonts.body,
159
+ }}
160
+ >
161
+ {finding.risk_score}
162
+ </td>
163
+ <td style={{ padding: '8px' }}>
164
+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: '2px' }}>
165
+ {finding.risk_tags?.map((tag, tagIndex) => (
166
+ <span
167
+ key={tagIndex}
168
+ style={{
169
+ padding: '2px 6px',
170
+ background: colors.bgCard,
171
+ borderRadius: '4px',
172
+ fontSize: '10px',
173
+ color: colors.textSecondary,
174
+ border: `1px solid ${colors.borderLight}`,
175
+ fontFamily: fonts.body,
176
+ }}
177
+ >
178
+ {tag}
179
+ </span>
180
+ ))}
181
+ </div>
182
+ </td>
183
+ <td
184
+ style={{
185
+ padding: '8px',
186
+ fontSize: '12px',
187
+ color: colors.textSecondary,
188
+ fontFamily: fonts.body,
189
+ }}
190
+ >
191
+ <ul
192
+ style={{ listStyle: 'disc', listStylePosition: 'inside', margin: 0, padding: 0 }}
193
+ >
194
+ {finding.reasons?.map((reason, reasonIndex) => (
195
+ <li key={reasonIndex} style={{ fontSize: '10px', marginBottom: '2px' }}>
196
+ {reason}
197
+ </li>
198
+ ))}
199
+ </ul>
200
+ </td>
201
+ <td
202
+ style={{
203
+ padding: '8px',
204
+ fontSize: '10px',
205
+ color: colors.textSecondary,
206
+ maxWidth: '200px',
207
+ fontFamily: fonts.body,
208
+ }}
209
+ >
210
+ {finding.safe_use_notes}
211
+ </td>
212
+ {type === 'tool' && finding.hasOwnProperty('is_potentially_poisoned') && (
213
+ <td style={{ padding: '8px' }}>
214
+ {finding.is_potentially_poisoned ? (
215
+ <span
216
+ style={{
217
+ display: 'inline-flex',
218
+ alignItems: 'center',
219
+ padding: '2px 6px',
220
+ fontSize: '10px',
221
+ fontWeight: '500',
222
+ borderRadius: '4px',
223
+ background: colors.error + '20',
224
+ color: colors.error,
225
+ border: `1px solid ${colors.error}40`,
226
+ fontFamily: fonts.body,
227
+ }}
228
+ >
229
+ Yes
230
+ </span>
231
+ ) : (
232
+ <span
233
+ style={{
234
+ display: 'inline-flex',
235
+ alignItems: 'center',
236
+ padding: '2px 6px',
237
+ fontSize: '10px',
238
+ fontWeight: '500',
239
+ borderRadius: '4px',
240
+ background: colors.accentGreen + '20',
241
+ color: colors.accentGreen,
242
+ border: `1px solid ${colors.accentGreen}40`,
243
+ fontFamily: fonts.body,
244
+ }}
245
+ >
246
+ No
247
+ </span>
248
+ )}
249
+ </td>
250
+ )}
251
+ </tr>
252
+ ))}
253
+ </tbody>
254
+ </table>
255
+ </div>
256
+ );
257
+ }
@@ -0,0 +1,75 @@
1
+ import { colors, fonts } from '../../theme';
2
+ import ScanResultsDisplay from './ScanResultsDisplay';
3
+ import ScanDetailView from './ScanDetailView';
4
+
5
+ export default function ListViewContent({
6
+ error,
7
+ loadingScans,
8
+ selectedScan,
9
+ loadingScanDetail,
10
+ allScans,
11
+ setSelectedScan,
12
+ loadScanDetail,
13
+ onViewScan,
14
+ }) {
15
+ if (loadingScans) {
16
+ return (
17
+ <div
18
+ style={{
19
+ flex: 1,
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ justifyContent: 'center',
23
+ padding: '24px',
24
+ background: colors.bgPrimary,
25
+ }}
26
+ >
27
+ <p style={{ color: colors.textSecondary, fontFamily: fonts.body }}>
28
+ Loading cached scans...
29
+ </p>
30
+ </div>
31
+ );
32
+ }
33
+
34
+ if (selectedScan) {
35
+ return (
36
+ <ScanDetailView
37
+ scan={selectedScan}
38
+ loading={loadingScanDetail}
39
+ onClose={() => {
40
+ setSelectedScan(null);
41
+ loadScanDetail(null);
42
+ }}
43
+ />
44
+ );
45
+ }
46
+
47
+ return (
48
+ <>
49
+ {error && (
50
+ <div
51
+ style={{
52
+ padding: '12px 16px',
53
+ background: colors.error + '20',
54
+ border: `1px solid ${colors.error}`,
55
+ borderRadius: '8px',
56
+ marginBottom: '16px',
57
+ color: colors.error,
58
+ fontSize: '13px',
59
+ fontFamily: fonts.body,
60
+ }}
61
+ >
62
+ {error}
63
+ </div>
64
+ )}
65
+ <ScanResultsDisplay
66
+ error={error}
67
+ scanning={false}
68
+ selectedServers={[]}
69
+ scanResults={allScans}
70
+ scanResult={null}
71
+ onViewScan={onViewScan}
72
+ />
73
+ </>
74
+ );
75
+ }
@@ -0,0 +1,75 @@
1
+ import { colors, fonts } from '../../theme';
2
+ import ExpandableSection from './ExpandableSection';
3
+
4
+ export default function NotablePatternsSection({ patterns }) {
5
+ if (!patterns || patterns.length === 0) return null;
6
+
7
+ return (
8
+ <ExpandableSection title="Notable Patterns" count={patterns.length} defaultExpanded={false}>
9
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
10
+ {patterns.map((pattern, index) => (
11
+ <div
12
+ key={index}
13
+ style={{
14
+ display: 'flex',
15
+ alignItems: 'flex-start',
16
+ gap: '8px',
17
+ padding: '8px',
18
+ background: colors.accentOrange + '10',
19
+ borderRadius: '6px',
20
+ border: `1px solid ${colors.accentOrange}20`,
21
+ transition: 'all 0.15s',
22
+ }}
23
+ onMouseEnter={(e) => {
24
+ e.currentTarget.style.background = colors.accentOrange + '15';
25
+ e.currentTarget.style.borderColor = colors.accentOrange + '40';
26
+ }}
27
+ onMouseLeave={(e) => {
28
+ e.currentTarget.style.background = colors.accentOrange + '10';
29
+ e.currentTarget.style.borderColor = colors.accentOrange + '20';
30
+ }}
31
+ >
32
+ <div
33
+ style={{
34
+ flexShrink: 0,
35
+ marginTop: '2px',
36
+ width: '16px',
37
+ height: '16px',
38
+ borderRadius: '50%',
39
+ background: colors.accentOrange + '30',
40
+ border: `1px solid ${colors.accentOrange}60`,
41
+ display: 'flex',
42
+ alignItems: 'center',
43
+ justifyContent: 'center',
44
+ }}
45
+ >
46
+ <svg
47
+ style={{ width: '10px', height: '10px', color: colors.accentOrange }}
48
+ fill="currentColor"
49
+ viewBox="0 0 20 20"
50
+ >
51
+ <path
52
+ fillRule="evenodd"
53
+ d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
54
+ clipRule="evenodd"
55
+ />
56
+ </svg>
57
+ </div>
58
+ <p
59
+ style={{
60
+ fontSize: '12px',
61
+ color: colors.textPrimary,
62
+ lineHeight: '1.5',
63
+ flex: 1,
64
+ margin: 0,
65
+ fontFamily: fonts.body,
66
+ }}
67
+ >
68
+ {pattern}
69
+ </p>
70
+ </div>
71
+ ))}
72
+ </div>
73
+ </ExpandableSection>
74
+ );
75
+ }
@@ -0,0 +1,72 @@
1
+ import { colors, fonts } from '../../theme';
2
+ import { getRiskLevelColor } from './utils';
3
+ import ExpandableSection from './ExpandableSection';
4
+
5
+ export default function OverallSummarySection({ overallRiskLevel, overallReason }) {
6
+ if (!overallRiskLevel) return null;
7
+
8
+ return (
9
+ <ExpandableSection title="Overall Summary" count={overallReason ? 1 : 0} defaultExpanded={true}>
10
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
11
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
12
+ <span
13
+ style={{
14
+ fontSize: '12px',
15
+ fontWeight: '600',
16
+ color: colors.textPrimary,
17
+ fontFamily: fonts.body,
18
+ }}
19
+ >
20
+ Overall Risk Level:
21
+ </span>
22
+ <span
23
+ style={{
24
+ display: 'inline-flex',
25
+ alignItems: 'center',
26
+ padding: '2px 8px',
27
+ borderRadius: '4px',
28
+ fontSize: '10px',
29
+ fontWeight: '700',
30
+ color: colors.textInverse,
31
+ background: getRiskLevelColor(overallRiskLevel),
32
+ fontFamily: fonts.body,
33
+ }}
34
+ >
35
+ {overallRiskLevel.toUpperCase()}
36
+ </span>
37
+ </div>
38
+ {overallReason && (
39
+ <div style={{ fontSize: '12px', color: colors.textSecondary, fontFamily: fonts.body }}>
40
+ {(() => {
41
+ const separator = overallReason.includes('\n')
42
+ ? '\n'
43
+ : overallReason.includes(' | ')
44
+ ? ' | '
45
+ : null;
46
+
47
+ if (separator) {
48
+ return (
49
+ <ul
50
+ style={{
51
+ listStyle: 'disc',
52
+ listStylePosition: 'inside',
53
+ margin: 0,
54
+ paddingLeft: '8px',
55
+ }}
56
+ >
57
+ {overallReason.split(separator).map((item, index) => (
58
+ <li key={index} style={{ fontSize: '12px', marginBottom: '2px' }}>
59
+ {item.trim()}
60
+ </li>
61
+ ))}
62
+ </ul>
63
+ );
64
+ }
65
+ return <p style={{ fontSize: '12px' }}>{overallReason}</p>;
66
+ })()}
67
+ </div>
68
+ )}
69
+ </div>
70
+ </ExpandableSection>
71
+ );
72
+ }
@@ -0,0 +1,52 @@
1
+ import { colors, fonts } from '../../theme';
2
+
3
+ export default function RawDataSection({ scan }) {
4
+ return (
5
+ <div style={{ marginBottom: '24px' }}>
6
+ <h3
7
+ style={{
8
+ fontSize: '13px',
9
+ fontWeight: '600',
10
+ color: colors.textPrimary,
11
+ fontFamily: fonts.body,
12
+ marginBottom: '12px',
13
+ paddingBottom: '8px',
14
+ borderBottom: `1px solid ${colors.borderLight}`,
15
+ }}
16
+ >
17
+ Raw Data
18
+ </h3>
19
+ <details>
20
+ <summary
21
+ style={{
22
+ cursor: 'pointer',
23
+ padding: '8px',
24
+ background: colors.bgTertiary,
25
+ borderRadius: '4px',
26
+ fontSize: '11px',
27
+ color: colors.textSecondary,
28
+ fontFamily: fonts.body,
29
+ marginBottom: '8px',
30
+ }}
31
+ >
32
+ Click to view raw JSON data
33
+ </summary>
34
+ <pre
35
+ style={{
36
+ padding: '12px',
37
+ background: colors.bgTertiary,
38
+ borderRadius: '6px',
39
+ fontSize: '11px',
40
+ fontFamily: 'monospace',
41
+ color: colors.textPrimary,
42
+ overflow: 'auto',
43
+ maxHeight: '400px',
44
+ margin: 0,
45
+ }}
46
+ >
47
+ {JSON.stringify(scan, null, 2)}
48
+ </pre>
49
+ </details>
50
+ </div>
51
+ );
52
+ }
@@ -0,0 +1,78 @@
1
+ import { colors, fonts } from '../../theme';
2
+ import ExpandableSection from './ExpandableSection';
3
+
4
+ export default function RecommendationsSection({ recommendations }) {
5
+ if (!recommendations || recommendations.length === 0) return null;
6
+
7
+ return (
8
+ <ExpandableSection
9
+ title="Recommendations"
10
+ count={recommendations.length}
11
+ defaultExpanded={false}
12
+ >
13
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
14
+ {recommendations.map((recommendation, index) => (
15
+ <div
16
+ key={index}
17
+ style={{
18
+ display: 'flex',
19
+ alignItems: 'flex-start',
20
+ gap: '8px',
21
+ padding: '8px',
22
+ background: colors.accentBlue + '10',
23
+ borderRadius: '6px',
24
+ border: `1px solid ${colors.accentBlue}20`,
25
+ transition: 'all 0.15s',
26
+ }}
27
+ onMouseEnter={(e) => {
28
+ e.currentTarget.style.background = colors.accentBlue + '15';
29
+ e.currentTarget.style.borderColor = colors.accentBlue + '40';
30
+ }}
31
+ onMouseLeave={(e) => {
32
+ e.currentTarget.style.background = colors.accentBlue + '10';
33
+ e.currentTarget.style.borderColor = colors.accentBlue + '20';
34
+ }}
35
+ >
36
+ <div
37
+ style={{
38
+ flexShrink: 0,
39
+ marginTop: '2px',
40
+ width: '16px',
41
+ height: '16px',
42
+ borderRadius: '50%',
43
+ background: colors.accentBlue + '30',
44
+ border: `1px solid ${colors.accentBlue}60`,
45
+ display: 'flex',
46
+ alignItems: 'center',
47
+ justifyContent: 'center',
48
+ }}
49
+ >
50
+ <span
51
+ style={{
52
+ fontSize: '10px',
53
+ fontWeight: '600',
54
+ color: colors.accentBlue,
55
+ fontFamily: fonts.body,
56
+ }}
57
+ >
58
+ {index + 1}
59
+ </span>
60
+ </div>
61
+ <p
62
+ style={{
63
+ fontSize: '12px',
64
+ color: colors.textPrimary,
65
+ lineHeight: '1.5',
66
+ flex: 1,
67
+ margin: 0,
68
+ fontFamily: fonts.body,
69
+ }}
70
+ >
71
+ {recommendation}
72
+ </p>
73
+ </div>
74
+ ))}
75
+ </div>
76
+ </ExpandableSection>
77
+ );
78
+ }