@mcp-shark/mcp-shark 1.5.8 → 1.5.10
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/README.md +3 -2
- package/core/configs/environment.js +10 -7
- package/core/configs/index.js +0 -1
- package/core/constants/Defaults.js +2 -0
- package/core/libraries/TransportLibrary.js +3 -1
- package/core/mcp-server/auditor/audit.js +1 -2
- package/core/mcp-server/index.js +22 -6
- package/core/mcp-server/server/external/single/transport.js +2 -2
- package/core/repositories/AuditRepository.js +51 -0
- package/core/repositories/StatisticsRepository.js +1 -1
- package/core/services/ConfigDetectionService.js +35 -22
- package/core/services/ServerManagementService.js +25 -4
- package/package.json +29 -4
- package/ui/dist/assets/index-D1MNKhKd.js +44 -0
- package/ui/dist/index.html +1 -1
- package/ui/server/controllers/ServerManagementController.js +3 -0
- package/ui/src/App.jsx +13 -5
- package/ui/src/ShutdownPage.jsx +91 -0
- package/ui/src/components/App/ActionMenu.jsx +179 -0
- package/ui/src/components/App/ApiDocsButton.jsx +56 -35
- package/ui/src/components/App/HelpButton.jsx +57 -35
- package/ui/src/components/App/ShutdownButton.jsx +142 -0
- package/ui/src/components/ShuttingDownModal.jsx +100 -0
- package/ui/src/setupTests.js +1 -0
- package/core/configs/codex.js +0 -68
- package/ui/dist/assets/index-CArYxKxS.js +0 -35
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { IconLoader2 } from '@tabler/icons-react';
|
|
2
|
+
import { colors, fonts } from '../theme';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Modal showing shutdown progress with spinner
|
|
6
|
+
*/
|
|
7
|
+
function ShuttingDownModal({ isOpen }) {
|
|
8
|
+
if (!isOpen) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<dialog
|
|
14
|
+
open
|
|
15
|
+
aria-modal="true"
|
|
16
|
+
style={{
|
|
17
|
+
position: 'fixed',
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
right: 0,
|
|
21
|
+
bottom: 0,
|
|
22
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
zIndex: 10000,
|
|
27
|
+
border: 'none',
|
|
28
|
+
margin: 0,
|
|
29
|
+
width: '100%',
|
|
30
|
+
height: '100%',
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<div
|
|
34
|
+
role="document"
|
|
35
|
+
style={{
|
|
36
|
+
background: colors.bgCard,
|
|
37
|
+
borderRadius: '12px',
|
|
38
|
+
padding: '32px',
|
|
39
|
+
maxWidth: '400px',
|
|
40
|
+
width: '90%',
|
|
41
|
+
boxShadow: `0 4px 20px ${colors.shadowLg}`,
|
|
42
|
+
fontFamily: fonts.body,
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<h3
|
|
47
|
+
style={{
|
|
48
|
+
margin: '0 0 16px 0',
|
|
49
|
+
fontSize: '20px',
|
|
50
|
+
fontWeight: '600',
|
|
51
|
+
color: colors.textPrimary,
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
Shutting Down...
|
|
55
|
+
</h3>
|
|
56
|
+
<p
|
|
57
|
+
style={{
|
|
58
|
+
margin: '0 0 24px 0',
|
|
59
|
+
fontSize: '14px',
|
|
60
|
+
color: colors.textSecondary,
|
|
61
|
+
lineHeight: '1.5',
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
MCP Shark is shutting down. The server will stop in a moment.
|
|
65
|
+
</p>
|
|
66
|
+
<div
|
|
67
|
+
style={{
|
|
68
|
+
display: 'flex',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
marginBottom: '16px',
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<IconLoader2
|
|
75
|
+
size={48}
|
|
76
|
+
stroke={2}
|
|
77
|
+
color={colors.error}
|
|
78
|
+
style={{
|
|
79
|
+
animation: 'shutdown-spin 1s linear infinite',
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<style>
|
|
84
|
+
{`
|
|
85
|
+
@keyframes shutdown-spin {
|
|
86
|
+
from {
|
|
87
|
+
transform: rotate(0deg);
|
|
88
|
+
}
|
|
89
|
+
to {
|
|
90
|
+
transform: rotate(360deg);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`}
|
|
94
|
+
</style>
|
|
95
|
+
</div>
|
|
96
|
+
</dialog>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default ShuttingDownModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/core/configs/codex.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { ConfigParserFactory } from '#core/services/parsers/ConfigParserFactory.js';
|
|
4
|
-
import { Environment } from './environment.js';
|
|
5
|
-
|
|
6
|
-
const parserFactory = new ConfigParserFactory();
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Get Codex config.toml path
|
|
10
|
-
* Codex uses $CODEX_HOME/config.toml, defaulting to ~/.codex/config.toml
|
|
11
|
-
* @returns {string} Path to Codex config file
|
|
12
|
-
*/
|
|
13
|
-
export function getCodexConfigPath() {
|
|
14
|
-
const codexHome = Environment.getCodexHome();
|
|
15
|
-
return join(codexHome, 'config.toml');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Check if Codex config.toml exists
|
|
20
|
-
*/
|
|
21
|
-
export function codexConfigExists() {
|
|
22
|
-
return existsSync(getCodexConfigPath());
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Read and parse Codex config.toml
|
|
27
|
-
* Uses TomlConfigParser for parsing
|
|
28
|
-
*/
|
|
29
|
-
export function readCodexConfig() {
|
|
30
|
-
const configPath = getCodexConfigPath();
|
|
31
|
-
if (!existsSync(configPath)) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
const content = readFileSync(configPath, 'utf-8');
|
|
37
|
-
return parserFactory.parse(content, configPath);
|
|
38
|
-
} catch (_error) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Convert Codex mcp_servers TOML format to MCP Shark JSON format
|
|
45
|
-
* Uses TomlConfigParser for conversion
|
|
46
|
-
* @deprecated Use ConfigParserFactory.normalizeToInternalFormat() instead
|
|
47
|
-
*/
|
|
48
|
-
export function convertCodexConfigToMcpShark(codexConfig) {
|
|
49
|
-
return parserFactory.normalizeToInternalFormat(codexConfig);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Read Codex config and convert to MCP Shark format
|
|
54
|
-
* Uses ConfigParserFactory for unified parsing and conversion
|
|
55
|
-
*/
|
|
56
|
-
export function readCodexConfigAsMcpShark() {
|
|
57
|
-
const configPath = getCodexConfigPath();
|
|
58
|
-
if (!existsSync(configPath)) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
try {
|
|
63
|
-
const content = readFileSync(configPath, 'utf-8');
|
|
64
|
-
return parserFactory.parseAndNormalize(content, configPath);
|
|
65
|
-
} catch (_error) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|