cache-overflow-mcp 0.2.0 → 0.3.1
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/.env.example +3 -3
- package/AGENTS.md +235 -0
- package/E2E-TESTING.md +5 -5
- package/LICENSE +21 -0
- package/README.md +13 -6
- package/dist/prompts/index.d.ts +14 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +153 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +16 -2
- package/dist/server.js.map +1 -1
- package/dist/testing/mock-data.js +40 -40
- package/dist/tools/find-solution.d.ts.map +1 -1
- package/dist/tools/find-solution.js +25 -2
- package/dist/tools/find-solution.js.map +1 -1
- package/dist/tools/get-balance.d.ts +3 -0
- package/dist/tools/get-balance.d.ts.map +1 -0
- package/dist/tools/get-balance.js +34 -0
- package/dist/tools/get-balance.js.map +1 -0
- package/dist/tools/submit-feedback.js +1 -1
- package/dist/tools/submit-feedback.js.map +1 -1
- package/dist/tools/submit-verification.js +1 -1
- package/dist/tools/submit-verification.js.map +1 -1
- package/dist/tools/unlock-solution.d.ts.map +1 -1
- package/dist/tools/unlock-solution.js +3 -2
- package/dist/tools/unlock-solution.js.map +1 -1
- package/dist/ui/verification-dialog.js +267 -267
- package/package.json +3 -3
- package/{mock-server.js → scripts/mock-server.js} +1 -1
- package/src/cli.ts +10 -10
- package/src/client.test.ts +116 -116
- package/src/client.ts +76 -76
- package/src/config.ts +9 -9
- package/src/index.ts +3 -3
- package/src/prompts/index.ts +168 -0
- package/src/server.ts +19 -1
- package/src/testing/mock-data.ts +142 -142
- package/src/testing/mock-server.ts +176 -176
- package/src/tools/find-solution.ts +30 -2
- package/src/tools/index.ts +23 -23
- package/src/tools/submit-feedback.ts +1 -1
- package/src/tools/submit-verification.ts +1 -1
- package/src/tools/unlock-solution.ts +4 -2
- package/src/types.ts +39 -39
- package/src/ui/verification-dialog.ts +342 -342
- package/tsconfig.json +20 -20
- package/test-dialog.js +0 -37
|
@@ -1,272 +1,272 @@
|
|
|
1
1
|
import http from 'http';
|
|
2
2
|
import open from 'open';
|
|
3
|
-
const generateHTML = (title, body) => `
|
|
4
|
-
<!DOCTYPE html>
|
|
5
|
-
<html lang="en">
|
|
6
|
-
<head>
|
|
7
|
-
<meta charset="UTF-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
-
<title>Verify Solution | cache.overflow</title>
|
|
10
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
|
|
13
|
-
<style>
|
|
14
|
-
* {
|
|
15
|
-
margin: 0;
|
|
16
|
-
padding: 0;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
body {
|
|
21
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
|
|
22
|
-
background: #0A0A0B;
|
|
23
|
-
min-height: 100vh;
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
padding: 24px;
|
|
28
|
-
color: #fff;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.card {
|
|
32
|
-
background: linear-gradient(145deg, rgba(30, 30, 32, 0.9), rgba(20, 20, 22, 0.95));
|
|
33
|
-
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
34
|
-
border-radius: 20px;
|
|
35
|
-
padding: 48px;
|
|
36
|
-
max-width: 800px;
|
|
37
|
-
width: 100%;
|
|
38
|
-
backdrop-filter: blur(20px);
|
|
39
|
-
box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.badge {
|
|
43
|
-
display: inline-flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
gap: 8px;
|
|
46
|
-
background: rgba(139, 92, 246, 0.15);
|
|
47
|
-
border: 1px solid rgba(139, 92, 246, 0.3);
|
|
48
|
-
color: #A78BFA;
|
|
49
|
-
font-size: 13px;
|
|
50
|
-
font-weight: 500;
|
|
51
|
-
text-transform: uppercase;
|
|
52
|
-
letter-spacing: 0.5px;
|
|
53
|
-
padding: 10px 18px;
|
|
54
|
-
border-radius: 24px;
|
|
55
|
-
margin-bottom: 28px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.badge::before {
|
|
59
|
-
content: "";
|
|
60
|
-
width: 6px;
|
|
61
|
-
height: 6px;
|
|
62
|
-
background: #8B5CF6;
|
|
63
|
-
border-radius: 50%;
|
|
64
|
-
animation: pulse 2s ease-in-out infinite;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@keyframes pulse {
|
|
68
|
-
0%, 100% { opacity: 1; transform: scale(1); }
|
|
69
|
-
50% { opacity: 0.5; transform: scale(1.2); }
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
h1 {
|
|
73
|
-
font-size: 32px;
|
|
74
|
-
font-weight: 600;
|
|
75
|
-
color: #fff;
|
|
76
|
-
margin-bottom: 12px;
|
|
77
|
-
letter-spacing: -0.5px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.subtitle {
|
|
81
|
-
font-size: 18px;
|
|
82
|
-
color: rgba(255, 255, 255, 0.5);
|
|
83
|
-
margin-bottom: 32px;
|
|
84
|
-
line-height: 1.5;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.solution-card {
|
|
88
|
-
background: rgba(255, 255, 255, 0.03);
|
|
89
|
-
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
90
|
-
border-radius: 16px;
|
|
91
|
-
padding: 28px;
|
|
92
|
-
margin-bottom: 36px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.solution-title {
|
|
96
|
-
font-size: 20px;
|
|
97
|
-
font-weight: 500;
|
|
98
|
-
color: #fff;
|
|
99
|
-
margin-bottom: 16px;
|
|
100
|
-
line-height: 1.4;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.solution-body {
|
|
104
|
-
font-size: 16px;
|
|
105
|
-
line-height: 1.8;
|
|
106
|
-
color: rgba(255, 255, 255, 0.6);
|
|
107
|
-
max-height: 280px;
|
|
108
|
-
overflow-y: auto;
|
|
109
|
-
white-space: pre-wrap;
|
|
110
|
-
word-wrap: break-word;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.solution-body::-webkit-scrollbar {
|
|
114
|
-
width: 4px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.solution-body::-webkit-scrollbar-track {
|
|
118
|
-
background: transparent;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.solution-body::-webkit-scrollbar-thumb {
|
|
122
|
-
background: rgba(255, 255, 255, 0.1);
|
|
123
|
-
border-radius: 2px;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.buttons {
|
|
127
|
-
display: flex;
|
|
128
|
-
gap: 16px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.btn {
|
|
132
|
-
flex: 1;
|
|
133
|
-
padding: 22px 36px;
|
|
134
|
-
border: none;
|
|
135
|
-
border-radius: 14px;
|
|
136
|
-
font-family: inherit;
|
|
137
|
-
font-size: 20px;
|
|
138
|
-
font-weight: 600;
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
transition: all 0.2s ease;
|
|
141
|
-
position: relative;
|
|
142
|
-
overflow: hidden;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.btn-safe {
|
|
146
|
-
background: linear-gradient(135deg, #00FF41 0%, #00CC33 100%);
|
|
147
|
-
color: #000;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.btn-safe:hover {
|
|
151
|
-
transform: translateY(-2px);
|
|
152
|
-
box-shadow: 0 8px 24px rgba(0, 255, 65, 0.35);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.btn-safe:active {
|
|
156
|
-
transform: translateY(0);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.btn-unsafe {
|
|
160
|
-
background: linear-gradient(135deg, #FF4444 0%, #CC2233 100%);
|
|
161
|
-
color: #fff;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.btn-unsafe:hover {
|
|
165
|
-
transform: translateY(-2px);
|
|
166
|
-
box-shadow: 0 8px 24px rgba(255, 51, 51, 0.35);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.btn-unsafe:active {
|
|
170
|
-
transform: translateY(0);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.hint {
|
|
174
|
-
text-align: center;
|
|
175
|
-
margin-top: 28px;
|
|
176
|
-
font-size: 15px;
|
|
177
|
-
color: rgba(255, 255, 255, 0.3);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.hint kbd {
|
|
181
|
-
background: rgba(255, 255, 255, 0.1);
|
|
182
|
-
padding: 4px 10px;
|
|
183
|
-
border-radius: 6px;
|
|
184
|
-
font-family: inherit;
|
|
185
|
-
font-size: 14px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.completed {
|
|
189
|
-
text-align: center;
|
|
190
|
-
padding: 60px 20px;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.completed-icon {
|
|
194
|
-
width: 88px;
|
|
195
|
-
height: 88px;
|
|
196
|
-
border-radius: 50%;
|
|
197
|
-
display: flex;
|
|
198
|
-
align-items: center;
|
|
199
|
-
justify-content: center;
|
|
200
|
-
margin: 0 auto 28px;
|
|
201
|
-
font-size: 40px;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.completed-icon.safe {
|
|
205
|
-
background: linear-gradient(135deg, rgba(0, 255, 65, 0.2), rgba(0, 204, 51, 0.1));
|
|
206
|
-
border: 2px solid rgba(0, 255, 65, 0.5);
|
|
207
|
-
box-shadow: 0 0 32px rgba(0, 255, 65, 0.2);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.completed-icon.unsafe {
|
|
211
|
-
background: linear-gradient(135deg, rgba(255, 68, 68, 0.2), rgba(204, 34, 51, 0.1));
|
|
212
|
-
border: 2px solid rgba(255, 68, 68, 0.5);
|
|
213
|
-
box-shadow: 0 0 32px rgba(255, 68, 68, 0.2);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.completed h2 {
|
|
217
|
-
font-size: 28px;
|
|
218
|
-
font-weight: 600;
|
|
219
|
-
margin-bottom: 12px;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.completed p {
|
|
223
|
-
font-size: 18px;
|
|
224
|
-
color: rgba(255, 255, 255, 0.5);
|
|
225
|
-
}
|
|
226
|
-
</style>
|
|
227
|
-
</head>
|
|
228
|
-
<body>
|
|
229
|
-
<div class="card" id="main-card">
|
|
230
|
-
<div class="badge">Verification Required</div>
|
|
231
|
-
|
|
232
|
-
<h1>Is this solution safe?</h1>
|
|
233
|
-
<p class="subtitle">Review the code below and verify it's safe to use</p>
|
|
234
|
-
|
|
235
|
-
<div class="solution-card">
|
|
236
|
-
<div class="solution-title">${escapeHtml(title)}</div>
|
|
237
|
-
<div class="solution-body">${body ? escapeHtml(body) : 'Solution body not available.\nUnlock to view full content.'}</div>
|
|
238
|
-
</div>
|
|
239
|
-
|
|
240
|
-
<div class="buttons">
|
|
241
|
-
<button class="btn btn-safe" onclick="submit('safe')">Safe</button>
|
|
242
|
-
<button class="btn btn-unsafe" onclick="submit('unsafe')">Unsafe</button>
|
|
243
|
-
</div>
|
|
244
|
-
|
|
245
|
-
<div class="hint">
|
|
246
|
-
Press <kbd>S</kbd> for Safe or <kbd>U</kbd> for Unsafe
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
|
|
250
|
-
<script>
|
|
251
|
-
function submit(result) {
|
|
252
|
-
const isSafe = result === 'safe';
|
|
253
|
-
document.getElementById('main-card').innerHTML = \`
|
|
254
|
-
<div class="completed">
|
|
255
|
-
<div class="completed-icon \${result}">\${isSafe ? '✓' : '✕'}</div>
|
|
256
|
-
<h2>\${isSafe ? 'Marked as Safe' : 'Marked as Unsafe'}</h2>
|
|
257
|
-
<p>You can close this tab now</p>
|
|
258
|
-
</div>
|
|
259
|
-
\`;
|
|
260
|
-
fetch('/result?value=' + result).catch(() => {});
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
document.addEventListener('keydown', (e) => {
|
|
264
|
-
if (e.key === 's' || e.key === 'S') submit('safe');
|
|
265
|
-
if (e.key === 'u' || e.key === 'U') submit('unsafe');
|
|
266
|
-
});
|
|
267
|
-
</script>
|
|
268
|
-
</body>
|
|
269
|
-
</html>
|
|
3
|
+
const generateHTML = (title, body) => `
|
|
4
|
+
<!DOCTYPE html>
|
|
5
|
+
<html lang="en">
|
|
6
|
+
<head>
|
|
7
|
+
<meta charset="UTF-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
<title>Verify Solution | cache.overflow</title>
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
|
|
13
|
+
<style>
|
|
14
|
+
* {
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body {
|
|
21
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
|
|
22
|
+
background: #0A0A0B;
|
|
23
|
+
min-height: 100vh;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
padding: 24px;
|
|
28
|
+
color: #fff;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.card {
|
|
32
|
+
background: linear-gradient(145deg, rgba(30, 30, 32, 0.9), rgba(20, 20, 22, 0.95));
|
|
33
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
34
|
+
border-radius: 20px;
|
|
35
|
+
padding: 48px;
|
|
36
|
+
max-width: 800px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
backdrop-filter: blur(20px);
|
|
39
|
+
box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.badge {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 8px;
|
|
46
|
+
background: rgba(139, 92, 246, 0.15);
|
|
47
|
+
border: 1px solid rgba(139, 92, 246, 0.3);
|
|
48
|
+
color: #A78BFA;
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
text-transform: uppercase;
|
|
52
|
+
letter-spacing: 0.5px;
|
|
53
|
+
padding: 10px 18px;
|
|
54
|
+
border-radius: 24px;
|
|
55
|
+
margin-bottom: 28px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.badge::before {
|
|
59
|
+
content: "";
|
|
60
|
+
width: 6px;
|
|
61
|
+
height: 6px;
|
|
62
|
+
background: #8B5CF6;
|
|
63
|
+
border-radius: 50%;
|
|
64
|
+
animation: pulse 2s ease-in-out infinite;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes pulse {
|
|
68
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
69
|
+
50% { opacity: 0.5; transform: scale(1.2); }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
h1 {
|
|
73
|
+
font-size: 32px;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
color: #fff;
|
|
76
|
+
margin-bottom: 12px;
|
|
77
|
+
letter-spacing: -0.5px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.subtitle {
|
|
81
|
+
font-size: 18px;
|
|
82
|
+
color: rgba(255, 255, 255, 0.5);
|
|
83
|
+
margin-bottom: 32px;
|
|
84
|
+
line-height: 1.5;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.solution-card {
|
|
88
|
+
background: rgba(255, 255, 255, 0.03);
|
|
89
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
90
|
+
border-radius: 16px;
|
|
91
|
+
padding: 28px;
|
|
92
|
+
margin-bottom: 36px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.solution-title {
|
|
96
|
+
font-size: 20px;
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
color: #fff;
|
|
99
|
+
margin-bottom: 16px;
|
|
100
|
+
line-height: 1.4;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.solution-body {
|
|
104
|
+
font-size: 16px;
|
|
105
|
+
line-height: 1.8;
|
|
106
|
+
color: rgba(255, 255, 255, 0.6);
|
|
107
|
+
max-height: 280px;
|
|
108
|
+
overflow-y: auto;
|
|
109
|
+
white-space: pre-wrap;
|
|
110
|
+
word-wrap: break-word;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.solution-body::-webkit-scrollbar {
|
|
114
|
+
width: 4px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.solution-body::-webkit-scrollbar-track {
|
|
118
|
+
background: transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.solution-body::-webkit-scrollbar-thumb {
|
|
122
|
+
background: rgba(255, 255, 255, 0.1);
|
|
123
|
+
border-radius: 2px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.buttons {
|
|
127
|
+
display: flex;
|
|
128
|
+
gap: 16px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.btn {
|
|
132
|
+
flex: 1;
|
|
133
|
+
padding: 22px 36px;
|
|
134
|
+
border: none;
|
|
135
|
+
border-radius: 14px;
|
|
136
|
+
font-family: inherit;
|
|
137
|
+
font-size: 20px;
|
|
138
|
+
font-weight: 600;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
transition: all 0.2s ease;
|
|
141
|
+
position: relative;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.btn-safe {
|
|
146
|
+
background: linear-gradient(135deg, #00FF41 0%, #00CC33 100%);
|
|
147
|
+
color: #000;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.btn-safe:hover {
|
|
151
|
+
transform: translateY(-2px);
|
|
152
|
+
box-shadow: 0 8px 24px rgba(0, 255, 65, 0.35);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.btn-safe:active {
|
|
156
|
+
transform: translateY(0);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.btn-unsafe {
|
|
160
|
+
background: linear-gradient(135deg, #FF4444 0%, #CC2233 100%);
|
|
161
|
+
color: #fff;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.btn-unsafe:hover {
|
|
165
|
+
transform: translateY(-2px);
|
|
166
|
+
box-shadow: 0 8px 24px rgba(255, 51, 51, 0.35);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.btn-unsafe:active {
|
|
170
|
+
transform: translateY(0);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.hint {
|
|
174
|
+
text-align: center;
|
|
175
|
+
margin-top: 28px;
|
|
176
|
+
font-size: 15px;
|
|
177
|
+
color: rgba(255, 255, 255, 0.3);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.hint kbd {
|
|
181
|
+
background: rgba(255, 255, 255, 0.1);
|
|
182
|
+
padding: 4px 10px;
|
|
183
|
+
border-radius: 6px;
|
|
184
|
+
font-family: inherit;
|
|
185
|
+
font-size: 14px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.completed {
|
|
189
|
+
text-align: center;
|
|
190
|
+
padding: 60px 20px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.completed-icon {
|
|
194
|
+
width: 88px;
|
|
195
|
+
height: 88px;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
margin: 0 auto 28px;
|
|
201
|
+
font-size: 40px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.completed-icon.safe {
|
|
205
|
+
background: linear-gradient(135deg, rgba(0, 255, 65, 0.2), rgba(0, 204, 51, 0.1));
|
|
206
|
+
border: 2px solid rgba(0, 255, 65, 0.5);
|
|
207
|
+
box-shadow: 0 0 32px rgba(0, 255, 65, 0.2);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.completed-icon.unsafe {
|
|
211
|
+
background: linear-gradient(135deg, rgba(255, 68, 68, 0.2), rgba(204, 34, 51, 0.1));
|
|
212
|
+
border: 2px solid rgba(255, 68, 68, 0.5);
|
|
213
|
+
box-shadow: 0 0 32px rgba(255, 68, 68, 0.2);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.completed h2 {
|
|
217
|
+
font-size: 28px;
|
|
218
|
+
font-weight: 600;
|
|
219
|
+
margin-bottom: 12px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.completed p {
|
|
223
|
+
font-size: 18px;
|
|
224
|
+
color: rgba(255, 255, 255, 0.5);
|
|
225
|
+
}
|
|
226
|
+
</style>
|
|
227
|
+
</head>
|
|
228
|
+
<body>
|
|
229
|
+
<div class="card" id="main-card">
|
|
230
|
+
<div class="badge">Verification Required</div>
|
|
231
|
+
|
|
232
|
+
<h1>Is this solution safe?</h1>
|
|
233
|
+
<p class="subtitle">Review the code below and verify it's safe to use</p>
|
|
234
|
+
|
|
235
|
+
<div class="solution-card">
|
|
236
|
+
<div class="solution-title">${escapeHtml(title)}</div>
|
|
237
|
+
<div class="solution-body">${body ? escapeHtml(body) : 'Solution body not available.\nUnlock to view full content.'}</div>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<div class="buttons">
|
|
241
|
+
<button class="btn btn-safe" onclick="submit('safe')">Safe</button>
|
|
242
|
+
<button class="btn btn-unsafe" onclick="submit('unsafe')">Unsafe</button>
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<div class="hint">
|
|
246
|
+
Press <kbd>S</kbd> for Safe or <kbd>U</kbd> for Unsafe
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<script>
|
|
251
|
+
function submit(result) {
|
|
252
|
+
const isSafe = result === 'safe';
|
|
253
|
+
document.getElementById('main-card').innerHTML = \`
|
|
254
|
+
<div class="completed">
|
|
255
|
+
<div class="completed-icon \${result}">\${isSafe ? '✓' : '✕'}</div>
|
|
256
|
+
<h2>\${isSafe ? 'Marked as Safe' : 'Marked as Unsafe'}</h2>
|
|
257
|
+
<p>You can close this tab now</p>
|
|
258
|
+
</div>
|
|
259
|
+
\`;
|
|
260
|
+
fetch('/result?value=' + result).catch(() => {});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
document.addEventListener('keydown', (e) => {
|
|
264
|
+
if (e.key === 's' || e.key === 'S') submit('safe');
|
|
265
|
+
if (e.key === 'u' || e.key === 'U') submit('unsafe');
|
|
266
|
+
});
|
|
267
|
+
</script>
|
|
268
|
+
</body>
|
|
269
|
+
</html>
|
|
270
270
|
`;
|
|
271
271
|
function escapeHtml(text) {
|
|
272
272
|
return text
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cache-overflow-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server for cache.overflow - AI agents sharing knowledge with AI agents",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"cache-overflow-mcp": "
|
|
9
|
+
"cache-overflow-mcp": "dist/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"claude",
|
|
25
25
|
"cursor"
|
|
26
26
|
],
|
|
27
|
-
"author": "",
|
|
27
|
+
"author": "cache.overflow",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=18.0.0"
|
package/src/cli.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { CacheOverflowServer } from './server.js';
|
|
4
|
-
|
|
5
|
-
async function main() {
|
|
6
|
-
const server = new CacheOverflowServer();
|
|
7
|
-
await server.start();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
main().catch(console.error);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { CacheOverflowServer } from './server.js';
|
|
4
|
+
|
|
5
|
+
async function main() {
|
|
6
|
+
const server = new CacheOverflowServer();
|
|
7
|
+
await server.start();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
main().catch(console.error);
|