mcponce 0.1.0 → 0.2.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/README.md +4 -0
- package/dist/cli/analytics.d.ts +2 -1
- package/dist/cli/analytics.d.ts.map +1 -1
- package/dist/cli/analytics.js +41 -19
- package/dist/cli/analytics.js.map +1 -1
- package/dist/cli/bin.d.ts +5 -0
- package/dist/cli/bin.d.ts.map +1 -1
- package/dist/cli/bin.js +257 -11
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +9 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/app.d.ts +5 -2
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +32 -5
- package/dist/server/app.js.map +1 -1
- package/dist/server/hono.d.ts.map +1 -1
- package/dist/server/hono.js +4 -0
- package/dist/server/hono.js.map +1 -1
- package/dist/server/inspector.d.ts.map +1 -1
- package/dist/server/inspector.js +567 -640
- package/dist/server/inspector.js.map +1 -1
- package/dist/server/mcp.d.ts +4 -0
- package/dist/server/mcp.d.ts.map +1 -1
- package/dist/server/mcp.js +45 -2
- package/dist/server/mcp.js.map +1 -1
- package/package.json +1 -1
package/dist/server/inspector.js
CHANGED
|
@@ -2,675 +2,602 @@ import { resolveCompletion } from '../utils/completion.js';
|
|
|
2
2
|
import { normalizeResourceResult } from '../utils/media.js';
|
|
3
3
|
export function createInspectorHtml(serverName, version) {
|
|
4
4
|
return `<!DOCTYPE html>
|
|
5
|
-
<html lang="en">
|
|
5
|
+
<html lang="en" class="h-full bg-slate-950">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
9
|
<title>${serverName} — mcponce Inspector</title>
|
|
10
|
+
<!-- Tailwind CSS via CDN -->
|
|
11
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
12
|
+
<!-- EUIX Engine UMD via CDN -->
|
|
13
|
+
<script src="https://unpkg.com/euixjs/dist/EUIXEngine.umd.js"></script>
|
|
10
14
|
<style>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
--border: #1f293d;
|
|
17
|
-
--border-focus: #4f46e5;
|
|
18
|
-
--text: #f9fafb;
|
|
19
|
-
--text-muted: #9ca3af;
|
|
20
|
-
--text-dim: #6b7280;
|
|
21
|
-
--primary: #6366f1;
|
|
22
|
-
--primary-hover: #4f46e5;
|
|
23
|
-
--primary-glow: rgba(99, 102, 241, 0.25);
|
|
24
|
-
--success: #10b981;
|
|
25
|
-
--success-bg: rgba(16, 185, 129, 0.12);
|
|
26
|
-
--warning: #f59e0b;
|
|
27
|
-
--warning-bg: rgba(245, 158, 11, 0.12);
|
|
28
|
-
--error: #ef4444;
|
|
29
|
-
--error-bg: rgba(239, 68, 68, 0.12);
|
|
30
|
-
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
31
|
-
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
32
|
-
}
|
|
33
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
34
|
-
body {
|
|
35
|
-
font-family: var(--font-sans);
|
|
36
|
-
background: var(--bg);
|
|
37
|
-
color: var(--text);
|
|
38
|
-
line-height: 1.5;
|
|
39
|
-
height: 100vh;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
}
|
|
44
|
-
header {
|
|
45
|
-
background: var(--surface);
|
|
46
|
-
border-bottom: 1px solid var(--border);
|
|
47
|
-
padding: 0.75rem 1.25rem;
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: space-between;
|
|
51
|
-
flex-shrink: 0;
|
|
52
|
-
}
|
|
53
|
-
.brand {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 0.75rem;
|
|
57
|
-
}
|
|
58
|
-
.logo {
|
|
59
|
-
background: linear-gradient(135deg, #6366f1, #a855f7);
|
|
60
|
-
color: white;
|
|
61
|
-
font-weight: 800;
|
|
62
|
-
font-size: 0.85rem;
|
|
63
|
-
padding: 0.25rem 0.6rem;
|
|
64
|
-
border-radius: 6px;
|
|
65
|
-
letter-spacing: -0.02em;
|
|
66
|
-
}
|
|
67
|
-
.server-name {
|
|
68
|
-
font-weight: 700;
|
|
69
|
-
font-size: 1.05rem;
|
|
70
|
-
letter-spacing: -0.01em;
|
|
71
|
-
}
|
|
72
|
-
.badge {
|
|
73
|
-
font-size: 0.72rem;
|
|
74
|
-
padding: 0.15rem 0.5rem;
|
|
75
|
-
border-radius: 9999px;
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
text-transform: uppercase;
|
|
78
|
-
letter-spacing: 0.04em;
|
|
79
|
-
}
|
|
80
|
-
.badge-status {
|
|
81
|
-
background: var(--success-bg);
|
|
82
|
-
color: var(--success);
|
|
83
|
-
display: inline-flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
gap: 0.35rem;
|
|
86
|
-
}
|
|
87
|
-
.badge-status::before {
|
|
88
|
-
content: '';
|
|
89
|
-
width: 6px;
|
|
90
|
-
height: 6px;
|
|
91
|
-
border-radius: 50%;
|
|
92
|
-
background: var(--success);
|
|
93
|
-
box-shadow: 0 0 6px var(--success);
|
|
94
|
-
}
|
|
95
|
-
.badge-version {
|
|
96
|
-
background: var(--surface-hover);
|
|
97
|
-
color: var(--text-muted);
|
|
98
|
-
}
|
|
99
|
-
.nav-links {
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
gap: 0.75rem;
|
|
103
|
-
}
|
|
104
|
-
.nav-link {
|
|
105
|
-
color: var(--text-muted);
|
|
106
|
-
text-decoration: none;
|
|
107
|
-
font-size: 0.82rem;
|
|
108
|
-
font-weight: 500;
|
|
109
|
-
padding: 0.35rem 0.65rem;
|
|
110
|
-
border-radius: 6px;
|
|
111
|
-
border: 1px solid var(--border);
|
|
112
|
-
transition: all 0.15s;
|
|
113
|
-
}
|
|
114
|
-
.nav-link:hover {
|
|
115
|
-
background: var(--surface-hover);
|
|
116
|
-
color: var(--text);
|
|
117
|
-
border-color: var(--text-dim);
|
|
118
|
-
}
|
|
119
|
-
.container {
|
|
120
|
-
display: flex;
|
|
121
|
-
flex: 1;
|
|
122
|
-
overflow: hidden;
|
|
123
|
-
}
|
|
124
|
-
.sidebar {
|
|
125
|
-
width: 320px;
|
|
126
|
-
background: var(--surface);
|
|
127
|
-
border-right: 1px solid var(--border);
|
|
128
|
-
display: flex;
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
flex-shrink: 0;
|
|
131
|
-
}
|
|
132
|
-
.search-box {
|
|
133
|
-
padding: 0.85rem;
|
|
134
|
-
border-bottom: 1px solid var(--border);
|
|
135
|
-
}
|
|
136
|
-
.search-input {
|
|
137
|
-
width: 100%;
|
|
138
|
-
background: var(--bg);
|
|
139
|
-
border: 1px solid var(--border);
|
|
140
|
-
border-radius: 6px;
|
|
141
|
-
padding: 0.5rem 0.75rem;
|
|
142
|
-
color: var(--text);
|
|
143
|
-
font-size: 0.85rem;
|
|
144
|
-
outline: none;
|
|
145
|
-
transition: border-color 0.15s;
|
|
146
|
-
}
|
|
147
|
-
.search-input:focus {
|
|
148
|
-
border-color: var(--border-focus);
|
|
149
|
-
}
|
|
150
|
-
.section-tabs {
|
|
151
|
-
display: flex;
|
|
152
|
-
border-bottom: 1px solid var(--border);
|
|
153
|
-
background: rgba(0, 0, 0, 0.15);
|
|
154
|
-
}
|
|
155
|
-
.tab-btn {
|
|
156
|
-
flex: 1;
|
|
157
|
-
padding: 0.65rem 0.25rem;
|
|
158
|
-
background: none;
|
|
159
|
-
border: none;
|
|
160
|
-
color: var(--text-muted);
|
|
161
|
-
font-size: 0.78rem;
|
|
162
|
-
font-weight: 600;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
border-bottom: 2px solid transparent;
|
|
165
|
-
transition: all 0.15s;
|
|
166
|
-
}
|
|
167
|
-
.tab-btn:hover {
|
|
168
|
-
color: var(--text);
|
|
169
|
-
}
|
|
170
|
-
.tab-btn.active {
|
|
171
|
-
color: var(--primary);
|
|
172
|
-
border-bottom-color: var(--primary);
|
|
173
|
-
background: var(--surface);
|
|
174
|
-
}
|
|
175
|
-
.item-list {
|
|
176
|
-
flex: 1;
|
|
177
|
-
overflow-y: auto;
|
|
178
|
-
padding: 0.5rem;
|
|
179
|
-
}
|
|
180
|
-
.list-item {
|
|
181
|
-
padding: 0.65rem 0.75rem;
|
|
182
|
-
border-radius: 6px;
|
|
183
|
-
cursor: pointer;
|
|
184
|
-
margin-bottom: 0.25rem;
|
|
185
|
-
border: 1px solid transparent;
|
|
186
|
-
transition: all 0.15s;
|
|
187
|
-
}
|
|
188
|
-
.list-item:hover {
|
|
189
|
-
background: var(--surface-hover);
|
|
190
|
-
}
|
|
191
|
-
.list-item.active {
|
|
192
|
-
background: var(--surface-active);
|
|
193
|
-
border-color: var(--primary);
|
|
194
|
-
}
|
|
195
|
-
.item-name {
|
|
196
|
-
font-weight: 600;
|
|
197
|
-
font-size: 0.85rem;
|
|
198
|
-
font-family: var(--font-mono);
|
|
199
|
-
display: flex;
|
|
200
|
-
align-items: center;
|
|
201
|
-
justify-content: space-between;
|
|
202
|
-
}
|
|
203
|
-
.item-desc {
|
|
204
|
-
font-size: 0.75rem;
|
|
205
|
-
color: var(--text-muted);
|
|
206
|
-
margin-top: 0.2rem;
|
|
207
|
-
white-space: nowrap;
|
|
208
|
-
overflow: hidden;
|
|
209
|
-
text-overflow: ellipsis;
|
|
210
|
-
}
|
|
211
|
-
.main {
|
|
212
|
-
flex: 1;
|
|
213
|
-
overflow-y: auto;
|
|
214
|
-
padding: 1.5rem;
|
|
215
|
-
display: flex;
|
|
216
|
-
flex-direction: column;
|
|
217
|
-
gap: 1.25rem;
|
|
218
|
-
}
|
|
219
|
-
.card {
|
|
220
|
-
background: var(--surface);
|
|
221
|
-
border: 1px solid var(--border);
|
|
222
|
-
border-radius: 8px;
|
|
223
|
-
padding: 1.25rem;
|
|
224
|
-
}
|
|
225
|
-
.card-header {
|
|
226
|
-
display: flex;
|
|
227
|
-
align-items: center;
|
|
228
|
-
justify-content: space-between;
|
|
229
|
-
margin-bottom: 0.85rem;
|
|
230
|
-
padding-bottom: 0.75rem;
|
|
231
|
-
border-bottom: 1px solid var(--border);
|
|
232
|
-
}
|
|
233
|
-
.card-title {
|
|
234
|
-
font-size: 1.15rem;
|
|
235
|
-
font-weight: 700;
|
|
236
|
-
font-family: var(--font-mono);
|
|
237
|
-
}
|
|
238
|
-
.form-group {
|
|
239
|
-
margin-bottom: 1rem;
|
|
240
|
-
}
|
|
241
|
-
.form-label {
|
|
242
|
-
display: flex;
|
|
243
|
-
align-items: center;
|
|
244
|
-
justify-content: space-between;
|
|
245
|
-
font-size: 0.8rem;
|
|
246
|
-
font-weight: 600;
|
|
247
|
-
color: var(--text);
|
|
248
|
-
margin-bottom: 0.35rem;
|
|
249
|
-
font-family: var(--font-mono);
|
|
250
|
-
}
|
|
251
|
-
.form-type {
|
|
252
|
-
font-size: 0.72rem;
|
|
253
|
-
color: var(--text-muted);
|
|
254
|
-
font-weight: normal;
|
|
255
|
-
}
|
|
256
|
-
.form-input, .form-textarea {
|
|
257
|
-
width: 100%;
|
|
258
|
-
background: var(--bg);
|
|
259
|
-
border: 1px solid var(--border);
|
|
260
|
-
border-radius: 6px;
|
|
261
|
-
padding: 0.55rem 0.75rem;
|
|
262
|
-
color: var(--text);
|
|
263
|
-
font-size: 0.85rem;
|
|
264
|
-
font-family: var(--font-mono);
|
|
265
|
-
outline: none;
|
|
266
|
-
transition: border-color 0.15s;
|
|
267
|
-
}
|
|
268
|
-
.form-input:focus, .form-textarea:focus {
|
|
269
|
-
border-color: var(--border-focus);
|
|
270
|
-
}
|
|
271
|
-
.form-textarea {
|
|
272
|
-
min-height: 80px;
|
|
273
|
-
resize: vertical;
|
|
274
|
-
}
|
|
275
|
-
.form-checkbox {
|
|
276
|
-
margin-right: 0.5rem;
|
|
277
|
-
accent-color: var(--primary);
|
|
278
|
-
}
|
|
279
|
-
.actions {
|
|
280
|
-
display: flex;
|
|
281
|
-
gap: 0.75rem;
|
|
282
|
-
margin-top: 1rem;
|
|
283
|
-
}
|
|
284
|
-
.btn {
|
|
285
|
-
padding: 0.55rem 1.1rem;
|
|
286
|
-
border-radius: 6px;
|
|
287
|
-
font-weight: 600;
|
|
288
|
-
font-size: 0.85rem;
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
border: none;
|
|
291
|
-
transition: all 0.15s;
|
|
292
|
-
display: inline-flex;
|
|
293
|
-
align-items: center;
|
|
294
|
-
gap: 0.4rem;
|
|
295
|
-
}
|
|
296
|
-
.btn-primary {
|
|
297
|
-
background: var(--primary);
|
|
298
|
-
color: white;
|
|
299
|
-
box-shadow: 0 2px 8px var(--primary-glow);
|
|
300
|
-
}
|
|
301
|
-
.btn-primary:hover {
|
|
302
|
-
background: var(--primary-hover);
|
|
303
|
-
}
|
|
304
|
-
.btn-secondary {
|
|
305
|
-
background: var(--surface-hover);
|
|
306
|
-
color: var(--text);
|
|
307
|
-
border: 1px solid var(--border);
|
|
308
|
-
}
|
|
309
|
-
.btn-secondary:hover {
|
|
310
|
-
background: var(--surface-active);
|
|
311
|
-
}
|
|
312
|
-
.output-section {
|
|
313
|
-
background: var(--bg);
|
|
314
|
-
border: 1px solid var(--border);
|
|
315
|
-
border-radius: 6px;
|
|
316
|
-
padding: 1rem;
|
|
317
|
-
margin-top: 1rem;
|
|
318
|
-
}
|
|
319
|
-
.output-header {
|
|
320
|
-
display: flex;
|
|
321
|
-
align-items: center;
|
|
322
|
-
justify-content: space-between;
|
|
323
|
-
margin-bottom: 0.75rem;
|
|
324
|
-
font-size: 0.78rem;
|
|
325
|
-
color: var(--text-muted);
|
|
326
|
-
}
|
|
327
|
-
.output-pre {
|
|
328
|
-
font-family: var(--font-mono);
|
|
329
|
-
font-size: 0.82rem;
|
|
330
|
-
white-space: pre-wrap;
|
|
331
|
-
word-break: break-word;
|
|
332
|
-
color: #e2e8f0;
|
|
333
|
-
max-height: 400px;
|
|
334
|
-
overflow-y: auto;
|
|
335
|
-
}
|
|
336
|
-
.grid-stats {
|
|
337
|
-
display: grid;
|
|
338
|
-
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
339
|
-
gap: 1rem;
|
|
340
|
-
}
|
|
341
|
-
.stat-card {
|
|
342
|
-
background: var(--bg);
|
|
343
|
-
border: 1px solid var(--border);
|
|
344
|
-
border-radius: 6px;
|
|
345
|
-
padding: 1rem;
|
|
346
|
-
}
|
|
347
|
-
.stat-value {
|
|
348
|
-
font-size: 1.5rem;
|
|
349
|
-
font-weight: 700;
|
|
350
|
-
font-family: var(--font-mono);
|
|
351
|
-
color: var(--primary);
|
|
352
|
-
margin-top: 0.25rem;
|
|
353
|
-
}
|
|
354
|
-
.stat-label {
|
|
355
|
-
font-size: 0.75rem;
|
|
356
|
-
color: var(--text-muted);
|
|
357
|
-
text-transform: uppercase;
|
|
358
|
-
letter-spacing: 0.05em;
|
|
359
|
-
}
|
|
360
|
-
.toast {
|
|
361
|
-
position: fixed;
|
|
362
|
-
bottom: 1.5rem;
|
|
363
|
-
right: 1.5rem;
|
|
364
|
-
background: var(--surface);
|
|
365
|
-
border: 1px solid var(--border);
|
|
366
|
-
padding: 0.65rem 1.25rem;
|
|
367
|
-
border-radius: 6px;
|
|
368
|
-
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
|
369
|
-
font-size: 0.85rem;
|
|
370
|
-
color: var(--text);
|
|
371
|
-
opacity: 0;
|
|
372
|
-
transform: translateY(10px);
|
|
373
|
-
transition: all 0.2s;
|
|
374
|
-
pointer-events: none;
|
|
375
|
-
}
|
|
376
|
-
.toast.show {
|
|
377
|
-
opacity: 1;
|
|
378
|
-
transform: translateY(0);
|
|
379
|
-
}
|
|
15
|
+
/* Sleek dark scrollbar */
|
|
16
|
+
::-webkit-scrollbar { width: 6px; height: 6px; }
|
|
17
|
+
::-webkit-scrollbar-track { background: #020617; }
|
|
18
|
+
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
|
|
19
|
+
::-webkit-scrollbar-thumb:hover { background: #334155; }
|
|
380
20
|
</style>
|
|
381
21
|
</head>
|
|
382
|
-
<body>
|
|
383
|
-
<
|
|
384
|
-
<div class="
|
|
385
|
-
<
|
|
386
|
-
<
|
|
387
|
-
<span class="badge badge-version">v${version}</span>
|
|
388
|
-
<span class="badge badge-status">Active</span>
|
|
22
|
+
<body class="h-full bg-slate-950 text-slate-100 antialiased overflow-hidden select-none">
|
|
23
|
+
<div id="app" class="h-full w-full flex flex-col">
|
|
24
|
+
<div id="fallback-loading" class="flex-1 flex flex-col items-center justify-center gap-3 text-slate-400">
|
|
25
|
+
<div class="w-8 h-8 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin"></div>
|
|
26
|
+
<div class="text-sm font-medium">Initializing mcponce Inspector (EUIX Engine)...</div>
|
|
389
27
|
</div>
|
|
390
|
-
<div class="nav-links">
|
|
391
|
-
<a href="/metrics" target="_blank" class="nav-link">Prometheus (/metrics)</a>
|
|
392
|
-
<a href="/analytics" target="_blank" class="nav-link">Telemetry (/analytics)</a>
|
|
393
|
-
<a href="/health" target="_blank" class="nav-link">Health (/health)</a>
|
|
394
|
-
</div>
|
|
395
|
-
</header>
|
|
396
|
-
|
|
397
|
-
<div class="container">
|
|
398
|
-
<aside class="sidebar">
|
|
399
|
-
<div class="search-box">
|
|
400
|
-
<input type="text" id="search" class="search-input" placeholder="Search tools, resources, prompts...">
|
|
401
|
-
</div>
|
|
402
|
-
<div class="section-tabs">
|
|
403
|
-
<button class="tab-btn active" onclick="switchSection('tools')">Tools (<span id="count-tools">0</span>)</button>
|
|
404
|
-
<button class="tab-btn" onclick="switchSection('resources')">Resources (<span id="count-resources">0</span>)</button>
|
|
405
|
-
<button class="tab-btn" onclick="switchSection('prompts')">Prompts (<span id="count-prompts">0</span>)</button>
|
|
406
|
-
<button class="tab-btn" onclick="switchSection('metrics')">Metrics</button>
|
|
407
|
-
</div>
|
|
408
|
-
<div id="items-list" class="item-list"></div>
|
|
409
|
-
</aside>
|
|
410
|
-
|
|
411
|
-
<main class="main" id="workspace">
|
|
412
|
-
<div class="card">
|
|
413
|
-
<div class="card-title">Select an item from the sidebar to inspect and run</div>
|
|
414
|
-
</div>
|
|
415
|
-
</main>
|
|
416
28
|
</div>
|
|
417
29
|
|
|
418
|
-
<
|
|
30
|
+
<script id="euix-spec" type="text/xml">
|
|
31
|
+
<uid_spec>
|
|
32
|
+
<data_model>
|
|
33
|
+
<state id="serverName" type="string">${serverName}</state>
|
|
34
|
+
<state id="serverVersion" type="string">${version}</state>
|
|
35
|
+
<state id="serverPid" type="number">0</state>
|
|
36
|
+
<state id="serverUptime" type="number">0</state>
|
|
37
|
+
<state id="activeTab" type="string">tools</state>
|
|
38
|
+
<state id="searchQuery" type="string"></state>
|
|
39
|
+
<state id="selectedToolName" type="string"></state>
|
|
40
|
+
<state id="selectedResourceUri" type="string"></state>
|
|
41
|
+
<state id="selectedPromptName" type="string"></state>
|
|
42
|
+
<state id="toolArgsJson" type="string">{}</state>
|
|
43
|
+
<state id="promptArgsJson" type="string">{}</state>
|
|
44
|
+
<state id="resourceUriInput" type="string"></state>
|
|
45
|
+
<state id="executionResult" type="string"></state>
|
|
46
|
+
<state id="executionStatus" type="string"></state>
|
|
47
|
+
<state id="executionDuration" type="string"></state>
|
|
48
|
+
<state id="isLoading" type="boolean">false</state>
|
|
49
|
+
<state id="tools" type="array">[]</state>
|
|
50
|
+
<state id="resources" type="array">[]</state>
|
|
51
|
+
<state id="resourceTemplates" type="array">[]</state>
|
|
52
|
+
<state id="prompts" type="array">[]</state>
|
|
53
|
+
<state id="totalCalls" type="number">0</state>
|
|
54
|
+
<state id="totalErrors" type="number">0</state>
|
|
55
|
+
<state id="activeSessions" type="number">0</state>
|
|
56
|
+
<state id="avgDurationMs" type="number">0</state>
|
|
57
|
+
</data_model>
|
|
419
58
|
|
|
420
|
-
<
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
} catch (err) {
|
|
437
|
-
console.error('Failed to load inspector state:', err);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
59
|
+
<on_mount action="RUN_SCRIPT">
|
|
60
|
+
<![CDATA[
|
|
61
|
+
function loadInspectorState() {
|
|
62
|
+
fetch('/inspect/api/state')
|
|
63
|
+
.then(function(res) { return res.json(); })
|
|
64
|
+
.then(function(state) {
|
|
65
|
+
if (state.server) {
|
|
66
|
+
$data.serverName = state.server.name || $data.serverName;
|
|
67
|
+
$data.serverVersion = state.server.version || $data.serverVersion;
|
|
68
|
+
$data.serverPid = state.server.pid || 0;
|
|
69
|
+
$data.serverUptime = state.server.uptime || 0;
|
|
70
|
+
}
|
|
71
|
+
$data.tools = state.tools || [];
|
|
72
|
+
$data.resources = state.resources || [];
|
|
73
|
+
$data.resourceTemplates = state.resourceTemplates || [];
|
|
74
|
+
$data.prompts = state.prompts || [];
|
|
440
75
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
if (section === 'metrics') {
|
|
448
|
-
renderMetricsWorkspace();
|
|
449
|
-
}
|
|
450
|
-
}
|
|
76
|
+
var a = state.analytics || {};
|
|
77
|
+
var m = state.metrics || {};
|
|
78
|
+
$data.totalCalls = a.totalInvocations || 0;
|
|
79
|
+
$data.totalErrors = a.totalErrors || 0;
|
|
80
|
+
$data.activeSessions = m.activeSessions || 0;
|
|
81
|
+
$data.avgDurationMs = a.avgDurationMs ? Math.round(a.avgDurationMs) : 0;
|
|
451
82
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
})
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const item = document.createElement('div');
|
|
478
|
-
item.className = 'list-item' + (activeItem === p.name ? ' active' : '');
|
|
479
|
-
item.onclick = () => selectItem('prompts', p.name);
|
|
480
|
-
item.innerHTML = '<div class="item-name">' + p.name + '</div><div class="item-desc">' + (p.description || 'Prompt') + '</div>';
|
|
481
|
-
list.appendChild(item);
|
|
83
|
+
if ($data.tools.length > 0 && !$data.selectedToolName) {
|
|
84
|
+
$data.selectedToolName = $data.tools[0].name;
|
|
85
|
+
var sample = {};
|
|
86
|
+
if ($data.tools[0].inputSchema && $data.tools[0].inputSchema.properties) {
|
|
87
|
+
for (var k in $data.tools[0].inputSchema.properties) {
|
|
88
|
+
var p = $data.tools[0].inputSchema.properties[k];
|
|
89
|
+
sample[k] = p.default !== undefined ? p.default : (p.type === 'number' ? 0 : (p.type === 'boolean' ? false : ''));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
$data.toolArgsJson = JSON.stringify(sample, null, 2);
|
|
93
|
+
}
|
|
94
|
+
if ($data.resources.length > 0 && !$data.selectedResourceUri) {
|
|
95
|
+
$data.selectedResourceUri = $data.resources[0].uri;
|
|
96
|
+
$data.resourceUriInput = $data.resources[0].uri;
|
|
97
|
+
} else if ($data.resourceTemplates.length > 0 && !$data.selectedResourceUri) {
|
|
98
|
+
$data.selectedResourceUri = $data.resourceTemplates[0].uriTemplate;
|
|
99
|
+
$data.resourceUriInput = $data.resourceTemplates[0].uriTemplate;
|
|
100
|
+
}
|
|
101
|
+
if ($data.prompts.length > 0 && !$data.selectedPromptName) {
|
|
102
|
+
$data.selectedPromptName = $data.prompts[0].name;
|
|
103
|
+
$data.promptArgsJson = '{}';
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
.catch(function(err) {
|
|
107
|
+
console.error('Failed to load inspector state:', err);
|
|
482
108
|
});
|
|
483
|
-
}
|
|
484
109
|
}
|
|
110
|
+
window.__refreshInspectorState = loadInspectorState;
|
|
111
|
+
loadInspectorState();
|
|
112
|
+
]]>
|
|
113
|
+
</on_mount>
|
|
485
114
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
115
|
+
<div class="flex flex-col h-full w-full bg-slate-950 text-slate-100 overflow-hidden font-sans">
|
|
116
|
+
<!-- Top Header -->
|
|
117
|
+
<header class="flex items-center justify-between px-5 py-3 bg-slate-900 border-b border-slate-800 flex-shrink-0">
|
|
118
|
+
<div class="flex items-center gap-3">
|
|
119
|
+
<div class="bg-gradient-to-r from-indigo-500 to-violet-600 text-white font-black text-xs px-2.5 py-1 rounded shadow-md tracking-wider">
|
|
120
|
+
MCPONCE
|
|
121
|
+
</div>
|
|
122
|
+
<div class="flex items-center gap-2">
|
|
123
|
+
<span class="font-bold text-sm tracking-tight text-white">{data.serverName}</span>
|
|
124
|
+
<span class="text-xs px-2 py-0.5 rounded-full bg-slate-800 text-slate-400 border border-slate-700 font-mono">
|
|
125
|
+
v{data.serverVersion}
|
|
126
|
+
</span>
|
|
127
|
+
<div class="flex items-center gap-1.5 px-2.5 py-0.5 rounded-full bg-emerald-950/60 border border-emerald-800/60 text-emerald-400 text-xs font-semibold">
|
|
128
|
+
<span class="w-2 h-2 rounded-full bg-emerald-400 animate-pulse"></span>
|
|
129
|
+
ONLINE
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
499
133
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
134
|
+
<!-- Navigation Tabs -->
|
|
135
|
+
<nav class="flex items-center gap-1.5">
|
|
136
|
+
<button class="px-3 py-1.5 rounded-lg text-xs font-medium transition-all {data.activeTab == 'tools' ? 'bg-indigo-600 text-white shadow-sm' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800'}">
|
|
137
|
+
<on_click action="SET_STATE">
|
|
138
|
+
<path>activeTab</path>
|
|
139
|
+
<value>tools</value>
|
|
140
|
+
</on_click>
|
|
141
|
+
Tools <span class="ml-1 px-1.5 py-0.2 rounded bg-slate-950/60 text-[10px] font-mono">{data.tools.length}</span>
|
|
142
|
+
</button>
|
|
143
|
+
<button class="px-3 py-1.5 rounded-lg text-xs font-medium transition-all {data.activeTab == 'resources' ? 'bg-indigo-600 text-white shadow-sm' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800'}">
|
|
144
|
+
<on_click action="SET_STATE">
|
|
145
|
+
<path>activeTab</path>
|
|
146
|
+
<value>resources</value>
|
|
147
|
+
</on_click>
|
|
148
|
+
Resources <span class="ml-1 px-1.5 py-0.2 rounded bg-slate-950/60 text-[10px] font-mono">{data.resources.length}</span>
|
|
149
|
+
</button>
|
|
150
|
+
<button class="px-3 py-1.5 rounded-lg text-xs font-medium transition-all {data.activeTab == 'prompts' ? 'bg-indigo-600 text-white shadow-sm' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800'}">
|
|
151
|
+
<on_click action="SET_STATE">
|
|
152
|
+
<path>activeTab</path>
|
|
153
|
+
<value>prompts</value>
|
|
154
|
+
</on_click>
|
|
155
|
+
Prompts <span class="ml-1 px-1.5 py-0.2 rounded bg-slate-950/60 text-[10px] font-mono">{data.prompts.length}</span>
|
|
156
|
+
</button>
|
|
157
|
+
<button class="px-3 py-1.5 rounded-lg text-xs font-medium transition-all {data.activeTab == 'metrics' ? 'bg-indigo-600 text-white shadow-sm' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800'}">
|
|
158
|
+
<on_click action="SET_STATE">
|
|
159
|
+
<path>activeTab</path>
|
|
160
|
+
<value>metrics</value>
|
|
161
|
+
</on_click>
|
|
162
|
+
Metrics
|
|
163
|
+
</button>
|
|
164
|
+
<div class="h-4 w-px bg-slate-800 mx-1"></div>
|
|
165
|
+
<button class="px-2.5 py-1.5 rounded-lg text-xs font-medium text-slate-400 hover:text-slate-200 hover:bg-slate-800 transition-colors flex items-center gap-1">
|
|
166
|
+
<on_click action="RUN_SCRIPT">
|
|
167
|
+
<![CDATA[
|
|
168
|
+
if (window.__refreshInspectorState) {
|
|
169
|
+
window.__refreshInspectorState();
|
|
170
|
+
}
|
|
171
|
+
]]>
|
|
172
|
+
</on_click>
|
|
173
|
+
Refresh
|
|
174
|
+
</button>
|
|
175
|
+
</nav>
|
|
176
|
+
</header>
|
|
524
177
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
178
|
+
<!-- Main Workspace -->
|
|
179
|
+
<div class="flex flex-1 overflow-hidden">
|
|
180
|
+
<!-- Sidebar -->
|
|
181
|
+
<aside class="w-80 border-r border-slate-800 bg-slate-900/40 flex flex-col flex-shrink-0">
|
|
182
|
+
<div class="p-3 border-b border-slate-800/80">
|
|
183
|
+
<input bind="searchQuery" placeholder="Filter items..." class="w-full px-3 py-1.5 text-xs bg-slate-950 border border-slate-800 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-indigo-500 transition-colors" />
|
|
184
|
+
</div>
|
|
528
185
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
186
|
+
<div class="flex-1 overflow-y-auto p-2 space-y-1">
|
|
187
|
+
<!-- Tools List -->
|
|
188
|
+
<div class="{data.activeTab == 'tools' ? 'block' : 'hidden'}">
|
|
189
|
+
<for_each items="{data.tools}" var="tool" key="name">
|
|
190
|
+
<div class="p-2.5 rounded-lg cursor-pointer transition-all border {data.selectedToolName == tool.name ? 'bg-indigo-950/60 border-indigo-500/70 text-white shadow-sm' : 'border-transparent text-slate-400 hover:bg-slate-800/60 hover:text-slate-200'}">
|
|
191
|
+
<on_click action="RUN_SCRIPT">
|
|
192
|
+
<![CDATA[
|
|
193
|
+
$data.selectedToolName = tool.name;
|
|
194
|
+
$data.executionResult = '';
|
|
195
|
+
$data.executionStatus = '';
|
|
196
|
+
$data.executionDuration = '';
|
|
197
|
+
var sample = {};
|
|
198
|
+
if (tool.inputSchema && tool.inputSchema.properties) {
|
|
199
|
+
for (var k in tool.inputSchema.properties) {
|
|
200
|
+
var p = tool.inputSchema.properties[k];
|
|
201
|
+
sample[k] = p.default !== undefined ? p.default : (p.type === 'number' ? 0 : (p.type === 'boolean' ? false : ''));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
$data.toolArgsJson = JSON.stringify(sample, null, 2);
|
|
205
|
+
]]>
|
|
206
|
+
</on_click>
|
|
207
|
+
<div class="flex items-center justify-between">
|
|
208
|
+
<span class="font-mono text-xs font-semibold text-indigo-300">{tool.name}</span>
|
|
209
|
+
</div>
|
|
210
|
+
<p class="text-[11px] text-slate-400 mt-1 line-clamp-2">{tool.description}</p>
|
|
211
|
+
</div>
|
|
212
|
+
</for_each>
|
|
213
|
+
</div>
|
|
537
214
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
const res = await fetch('/inspect/api/tools/' + encodeURIComponent(name), {
|
|
572
|
-
method: 'POST',
|
|
573
|
-
headers: { 'Content-Type': 'application/json' },
|
|
574
|
-
body: JSON.stringify({ args })
|
|
575
|
-
});
|
|
576
|
-
const duration = Math.round(performance.now() - start);
|
|
577
|
-
const data = await res.json();
|
|
215
|
+
<!-- Resources List -->
|
|
216
|
+
<div class="{data.activeTab == 'resources' ? 'block' : 'hidden'}">
|
|
217
|
+
<for_each items="{data.resources}" var="res" key="uri">
|
|
218
|
+
<div class="p-2.5 rounded-lg cursor-pointer transition-all border {data.selectedResourceUri == res.uri ? 'bg-indigo-950/60 border-indigo-500/70 text-white shadow-sm' : 'border-transparent text-slate-400 hover:bg-slate-800/60 hover:text-slate-200'}">
|
|
219
|
+
<on_click action="RUN_SCRIPT">
|
|
220
|
+
<![CDATA[
|
|
221
|
+
$data.selectedResourceUri = res.uri;
|
|
222
|
+
$data.resourceUriInput = res.uri;
|
|
223
|
+
$data.executionResult = '';
|
|
224
|
+
$data.executionStatus = '';
|
|
225
|
+
$data.executionDuration = '';
|
|
226
|
+
]]>
|
|
227
|
+
</on_click>
|
|
228
|
+
<div class="font-mono text-xs font-semibold text-emerald-300 truncate">{res.uri}</div>
|
|
229
|
+
<p class="text-[11px] text-slate-400 mt-0.5 line-clamp-1">{res.name}</p>
|
|
230
|
+
</div>
|
|
231
|
+
</for_each>
|
|
232
|
+
<for_each items="{data.resourceTemplates}" var="tpl" key="uriTemplate">
|
|
233
|
+
<div class="p-2.5 rounded-lg cursor-pointer transition-all border {data.selectedResourceUri == tpl.uriTemplate ? 'bg-indigo-950/60 border-indigo-500/70 text-white shadow-sm' : 'border-transparent text-slate-400 hover:bg-slate-800/60 hover:text-slate-200'}">
|
|
234
|
+
<on_click action="RUN_SCRIPT">
|
|
235
|
+
<![CDATA[
|
|
236
|
+
$data.selectedResourceUri = tpl.uriTemplate;
|
|
237
|
+
$data.resourceUriInput = tpl.uriTemplate;
|
|
238
|
+
$data.executionResult = '';
|
|
239
|
+
$data.executionStatus = '';
|
|
240
|
+
$data.executionDuration = '';
|
|
241
|
+
]]>
|
|
242
|
+
</on_click>
|
|
243
|
+
<div class="font-mono text-xs font-semibold text-cyan-300 truncate">{tpl.uriTemplate}</div>
|
|
244
|
+
<p class="text-[11px] text-slate-400 mt-0.5 line-clamp-1">Template</p>
|
|
245
|
+
</div>
|
|
246
|
+
</for_each>
|
|
247
|
+
</div>
|
|
578
248
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
249
|
+
<!-- Prompts List -->
|
|
250
|
+
<div class="{data.activeTab == 'prompts' ? 'block' : 'hidden'}">
|
|
251
|
+
<for_each items="{data.prompts}" var="prompt" key="name">
|
|
252
|
+
<div class="p-2.5 rounded-lg cursor-pointer transition-all border {data.selectedPromptName == prompt.name ? 'bg-indigo-950/60 border-indigo-500/70 text-white shadow-sm' : 'border-transparent text-slate-400 hover:bg-slate-800/60 hover:text-slate-200'}">
|
|
253
|
+
<on_click action="RUN_SCRIPT">
|
|
254
|
+
<![CDATA[
|
|
255
|
+
$data.selectedPromptName = prompt.name;
|
|
256
|
+
$data.executionResult = '';
|
|
257
|
+
$data.executionStatus = '';
|
|
258
|
+
$data.executionDuration = '';
|
|
259
|
+
var sample = {};
|
|
260
|
+
if (prompt.argsSchema && typeof prompt.argsSchema === 'object') {
|
|
261
|
+
for (var k in prompt.argsSchema) {
|
|
262
|
+
sample[k] = '';
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
$data.promptArgsJson = JSON.stringify(sample, null, 2);
|
|
266
|
+
]]>
|
|
267
|
+
</on_click>
|
|
268
|
+
<div class="font-mono text-xs font-semibold text-purple-300">{prompt.name}</div>
|
|
269
|
+
<p class="text-[11px] text-slate-400 mt-0.5 line-clamp-2">{prompt.description}</p>
|
|
270
|
+
</div>
|
|
271
|
+
</for_each>
|
|
272
|
+
</div>
|
|
593
273
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
274
|
+
<!-- Metrics Sidebar info -->
|
|
275
|
+
<div class="{data.activeTab == 'metrics' ? 'block p-3 space-y-2' : 'hidden'}">
|
|
276
|
+
<div class="text-xs font-semibold text-slate-300 uppercase tracking-wider">Telemetry Overview</div>
|
|
277
|
+
<div class="text-xs text-slate-400">Live operational server metrics and runtime statistics.</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</aside>
|
|
598
281
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
282
|
+
<!-- Main Detail / Workspace Panel -->
|
|
283
|
+
<main class="flex-1 flex flex-col overflow-y-auto bg-slate-950 p-6">
|
|
284
|
+
<!-- Tools Detail Panel -->
|
|
285
|
+
<div class="{data.activeTab == 'tools' ? 'flex flex-col gap-5' : 'hidden'}">
|
|
286
|
+
<div class="flex items-center justify-between pb-4 border-b border-slate-800">
|
|
287
|
+
<div>
|
|
288
|
+
<div class="text-xs text-slate-400 font-mono">Tool Inspection</div>
|
|
289
|
+
<h2 class="text-xl font-bold text-white font-mono mt-0.5">{data.selectedToolName}</h2>
|
|
290
|
+
</div>
|
|
291
|
+
<button class="px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-semibold rounded-lg shadow-sm transition-colors flex items-center gap-1.5">
|
|
292
|
+
<on_click action="RUN_SCRIPT">
|
|
293
|
+
<![CDATA[
|
|
294
|
+
$data.isLoading = true;
|
|
295
|
+
$data.executionStatus = 'loading';
|
|
296
|
+
$data.executionResult = 'Executing ' + $data.selectedToolName + '...';
|
|
297
|
+
$data.executionDuration = '';
|
|
602
298
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
299
|
+
var args = {};
|
|
300
|
+
try {
|
|
301
|
+
if ($data.toolArgsJson && $data.toolArgsJson.trim()) {
|
|
302
|
+
args = JSON.parse($data.toolArgsJson);
|
|
303
|
+
}
|
|
304
|
+
} catch (e) {
|
|
305
|
+
$data.isLoading = false;
|
|
306
|
+
$data.executionStatus = 'error';
|
|
307
|
+
$data.executionResult = 'Invalid JSON arguments: ' + e.message;
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
609
310
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
311
|
+
var startTime = Date.now();
|
|
312
|
+
fetch('/inspect/api/tools/' + encodeURIComponent($data.selectedToolName), {
|
|
313
|
+
method: 'POST',
|
|
314
|
+
headers: { 'Content-Type': 'application/json' },
|
|
315
|
+
body: JSON.stringify({ args: args })
|
|
316
|
+
})
|
|
317
|
+
.then(function(res) {
|
|
318
|
+
return res.json().then(function(json) {
|
|
319
|
+
return { ok: res.ok, status: res.status, data: json };
|
|
320
|
+
});
|
|
321
|
+
})
|
|
322
|
+
.then(function(res) {
|
|
323
|
+
$data.isLoading = false;
|
|
324
|
+
var duration = Date.now() - startTime;
|
|
325
|
+
$data.executionDuration = (res.data.durationMs != null ? res.data.durationMs : duration) + ' ms';
|
|
326
|
+
if (res.ok && res.data.success !== false) {
|
|
327
|
+
$data.executionStatus = 'success';
|
|
328
|
+
$data.executionResult = JSON.stringify(res.data.result || res.data, null, 2);
|
|
329
|
+
} else {
|
|
330
|
+
$data.executionStatus = 'error';
|
|
331
|
+
$data.executionResult = res.data.error || JSON.stringify(res.data, null, 2);
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
.catch(function(err) {
|
|
335
|
+
$data.isLoading = false;
|
|
336
|
+
$data.executionStatus = 'error';
|
|
337
|
+
$data.executionResult = 'Execution error: ' + err.message;
|
|
338
|
+
});
|
|
339
|
+
]]>
|
|
340
|
+
</on_click>
|
|
341
|
+
Run Tool (POST)
|
|
342
|
+
</button>
|
|
343
|
+
</div>
|
|
629
344
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}
|
|
345
|
+
<!-- Parameters Editor -->
|
|
346
|
+
<div class="flex flex-col gap-2">
|
|
347
|
+
<label class="text-xs font-semibold text-slate-300 flex items-center justify-between">
|
|
348
|
+
<span>Arguments (JSON)</span>
|
|
349
|
+
<span class="text-[11px] text-slate-500 font-normal">Edit parameters before running</span>
|
|
350
|
+
</label>
|
|
351
|
+
<textarea bind="toolArgsJson" rows="6" class="w-full p-3 font-mono text-xs bg-slate-900 border border-slate-800 rounded-lg text-slate-200 focus:outline-none focus:border-indigo-500 transition-colors" placeholder="{}"></textarea>
|
|
352
|
+
</div>
|
|
639
353
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
outText.textContent = String(err);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
354
|
+
<!-- Output Viewer -->
|
|
355
|
+
<div class="flex flex-col gap-2">
|
|
356
|
+
<div class="flex items-center justify-between">
|
|
357
|
+
<span class="text-xs font-semibold text-slate-300">Execution Output</span>
|
|
358
|
+
<div class="flex items-center gap-2">
|
|
359
|
+
<span class="text-xs text-slate-400 font-mono">{data.executionDuration}</span>
|
|
360
|
+
<span class="text-[11px] font-mono px-2 py-0.5 rounded font-semibold {data.executionStatus == 'success' ? 'bg-emerald-950 text-emerald-400 border border-emerald-800' : (data.executionStatus == 'error' ? 'bg-rose-950 text-rose-400 border border-rose-800' : 'hidden')}">
|
|
361
|
+
{data.executionStatus == 'success' ? '200 OK' : 'ERROR'}
|
|
362
|
+
</span>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
<pre class="p-4 rounded-lg font-mono text-xs bg-slate-900 border border-slate-800 text-slate-200 overflow-x-auto min-h-[140px] max-h-96">{data.executionResult || '// Output will appear here after execution'}</pre>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
657
368
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
369
|
+
<!-- Resources Detail Panel -->
|
|
370
|
+
<div class="{data.activeTab == 'resources' ? 'flex flex-col gap-5' : 'hidden'}">
|
|
371
|
+
<div class="flex items-center justify-between pb-4 border-b border-slate-800">
|
|
372
|
+
<div>
|
|
373
|
+
<div class="text-xs text-slate-400 font-mono">Resource Inspection</div>
|
|
374
|
+
<h2 class="text-xl font-bold text-white font-mono mt-0.5">Read Resource</h2>
|
|
375
|
+
</div>
|
|
376
|
+
<button class="px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-semibold rounded-lg shadow-sm transition-colors">
|
|
377
|
+
<on_click action="RUN_SCRIPT">
|
|
378
|
+
<![CDATA[
|
|
379
|
+
$data.isLoading = true;
|
|
380
|
+
$data.executionStatus = 'loading';
|
|
381
|
+
$data.executionResult = 'Reading resource ' + $data.resourceUriInput + '...';
|
|
382
|
+
$data.executionDuration = '';
|
|
383
|
+
|
|
384
|
+
var startTime = Date.now();
|
|
385
|
+
fetch('/inspect/api/resources/read', {
|
|
386
|
+
method: 'POST',
|
|
387
|
+
headers: { 'Content-Type': 'application/json' },
|
|
388
|
+
body: JSON.stringify({ uri: $data.resourceUriInput })
|
|
389
|
+
})
|
|
390
|
+
.then(function(res) {
|
|
391
|
+
return res.json().then(function(json) {
|
|
392
|
+
return { ok: res.ok, status: res.status, data: json };
|
|
393
|
+
});
|
|
394
|
+
})
|
|
395
|
+
.then(function(res) {
|
|
396
|
+
$data.isLoading = false;
|
|
397
|
+
var duration = Date.now() - startTime;
|
|
398
|
+
$data.executionDuration = duration + ' ms';
|
|
399
|
+
if (res.ok && res.data.success !== false) {
|
|
400
|
+
$data.executionStatus = 'success';
|
|
401
|
+
$data.executionResult = JSON.stringify(res.data.result || res.data, null, 2);
|
|
402
|
+
} else {
|
|
403
|
+
$data.executionStatus = 'error';
|
|
404
|
+
$data.executionResult = res.data.error || JSON.stringify(res.data, null, 2);
|
|
405
|
+
}
|
|
406
|
+
})
|
|
407
|
+
.catch(function(err) {
|
|
408
|
+
$data.isLoading = false;
|
|
409
|
+
$data.executionStatus = 'error';
|
|
410
|
+
$data.executionResult = 'Error: ' + err.message;
|
|
411
|
+
});
|
|
412
|
+
]]>
|
|
413
|
+
</on_click>
|
|
414
|
+
Read Resource (POST)
|
|
415
|
+
</button>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<div class="flex flex-col gap-2">
|
|
419
|
+
<label class="text-xs font-semibold text-slate-300">Resource URI</label>
|
|
420
|
+
<input bind="resourceUriInput" placeholder="custom://resource/path" class="w-full px-3 py-2 font-mono text-xs bg-slate-900 border border-slate-800 rounded-lg text-slate-200 focus:outline-none focus:border-indigo-500" />
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<div class="flex flex-col gap-2">
|
|
424
|
+
<div class="flex items-center justify-between">
|
|
425
|
+
<span class="text-xs font-semibold text-slate-300">Resource Payload</span>
|
|
426
|
+
<span class="text-xs text-slate-400 font-mono">{data.executionDuration}</span>
|
|
427
|
+
</div>
|
|
428
|
+
<pre class="p-4 rounded-lg font-mono text-xs bg-slate-900 border border-slate-800 text-slate-200 overflow-x-auto min-h-[140px] max-h-96">{data.executionResult || '// Resource contents will appear here'}</pre>
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<!-- Prompts Detail Panel -->
|
|
433
|
+
<div class="{data.activeTab == 'prompts' ? 'flex flex-col gap-5' : 'hidden'}">
|
|
434
|
+
<div class="flex items-center justify-between pb-4 border-b border-slate-800">
|
|
435
|
+
<div>
|
|
436
|
+
<div class="text-xs text-slate-400 font-mono">Prompt Inspection</div>
|
|
437
|
+
<h2 class="text-xl font-bold text-white font-mono mt-0.5">{data.selectedPromptName}</h2>
|
|
438
|
+
</div>
|
|
439
|
+
<button class="px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-semibold rounded-lg shadow-sm transition-colors">
|
|
440
|
+
<on_click action="RUN_SCRIPT">
|
|
441
|
+
<![CDATA[
|
|
442
|
+
$data.isLoading = true;
|
|
443
|
+
$data.executionStatus = 'loading';
|
|
444
|
+
$data.executionResult = 'Getting prompt ' + $data.selectedPromptName + '...';
|
|
445
|
+
$data.executionDuration = '';
|
|
446
|
+
|
|
447
|
+
var args = {};
|
|
448
|
+
try {
|
|
449
|
+
if ($data.promptArgsJson && $data.promptArgsJson.trim()) {
|
|
450
|
+
args = JSON.parse($data.promptArgsJson);
|
|
451
|
+
}
|
|
452
|
+
} catch (e) {
|
|
453
|
+
$data.isLoading = false;
|
|
454
|
+
$data.executionStatus = 'error';
|
|
455
|
+
$data.executionResult = 'Invalid JSON: ' + e.message;
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
var startTime = Date.now();
|
|
460
|
+
fetch('/inspect/api/prompts/get', {
|
|
461
|
+
method: 'POST',
|
|
462
|
+
headers: { 'Content-Type': 'application/json' },
|
|
463
|
+
body: JSON.stringify({ name: $data.selectedPromptName, args: args })
|
|
464
|
+
})
|
|
465
|
+
.then(function(res) {
|
|
466
|
+
return res.json().then(function(json) {
|
|
467
|
+
return { ok: res.ok, status: res.status, data: json };
|
|
468
|
+
});
|
|
469
|
+
})
|
|
470
|
+
.then(function(res) {
|
|
471
|
+
$data.isLoading = false;
|
|
472
|
+
var duration = Date.now() - startTime;
|
|
473
|
+
$data.executionDuration = duration + ' ms';
|
|
474
|
+
if (res.ok && res.data.success !== false) {
|
|
475
|
+
$data.executionStatus = 'success';
|
|
476
|
+
$data.executionResult = JSON.stringify(res.data.result || res.data, null, 2);
|
|
477
|
+
} else {
|
|
478
|
+
$data.executionStatus = 'error';
|
|
479
|
+
$data.executionResult = res.data.error || JSON.stringify(res.data, null, 2);
|
|
480
|
+
}
|
|
481
|
+
})
|
|
482
|
+
.catch(function(err) {
|
|
483
|
+
$data.isLoading = false;
|
|
484
|
+
$data.executionStatus = 'error';
|
|
485
|
+
$data.executionResult = 'Error: ' + err.message;
|
|
486
|
+
});
|
|
487
|
+
]]>
|
|
488
|
+
</on_click>
|
|
489
|
+
Get Prompt (POST)
|
|
490
|
+
</button>
|
|
491
|
+
</div>
|
|
492
|
+
|
|
493
|
+
<div class="flex flex-col gap-2">
|
|
494
|
+
<label class="text-xs font-semibold text-slate-300">Prompt Arguments (JSON)</label>
|
|
495
|
+
<textarea bind="promptArgsJson" rows="4" class="w-full p-3 font-mono text-xs bg-slate-900 border border-slate-800 rounded-lg text-slate-200 focus:outline-none focus:border-indigo-500" placeholder="{}"></textarea>
|
|
496
|
+
</div>
|
|
497
|
+
|
|
498
|
+
<div class="flex flex-col gap-2">
|
|
499
|
+
<div class="flex items-center justify-between">
|
|
500
|
+
<span class="text-xs font-semibold text-slate-300">Prompt Messages</span>
|
|
501
|
+
<span class="text-xs text-slate-400 font-mono">{data.executionDuration}</span>
|
|
502
|
+
</div>
|
|
503
|
+
<pre class="p-4 rounded-lg font-mono text-xs bg-slate-900 border border-slate-800 text-slate-200 overflow-x-auto min-h-[140px] max-h-96">{data.executionResult || '// Prompt messages will appear here'}</pre>
|
|
504
|
+
</div>
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<!-- Metrics Detail Panel -->
|
|
508
|
+
<div class="{data.activeTab == 'metrics' ? 'flex flex-col gap-6' : 'hidden'}">
|
|
509
|
+
<div class="pb-4 border-b border-slate-800">
|
|
510
|
+
<div class="text-xs text-slate-400 font-mono">Telemetry & Health</div>
|
|
511
|
+
<h2 class="text-xl font-bold text-white mt-0.5">Live Server Metrics</h2>
|
|
512
|
+
</div>
|
|
672
513
|
|
|
673
|
-
|
|
514
|
+
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
|
515
|
+
<div class="p-4 rounded-xl bg-slate-900 border border-slate-800 flex flex-col gap-1">
|
|
516
|
+
<span class="text-xs text-slate-400 font-medium">Total Invocations</span>
|
|
517
|
+
<span class="text-2xl font-bold text-white font-mono">{data.totalCalls}</span>
|
|
518
|
+
</div>
|
|
519
|
+
<div class="p-4 rounded-xl bg-slate-900 border border-slate-800 flex flex-col gap-1">
|
|
520
|
+
<span class="text-xs text-slate-400 font-medium">Total Errors</span>
|
|
521
|
+
<span class="text-2xl font-bold text-rose-400 font-mono">{data.totalErrors}</span>
|
|
522
|
+
</div>
|
|
523
|
+
<div class="p-4 rounded-xl bg-slate-900 border border-slate-800 flex flex-col gap-1">
|
|
524
|
+
<span class="text-xs text-slate-400 font-medium">Active Sessions</span>
|
|
525
|
+
<span class="text-2xl font-bold text-emerald-400 font-mono">{data.activeSessions}</span>
|
|
526
|
+
</div>
|
|
527
|
+
<div class="p-4 rounded-xl bg-slate-900 border border-slate-800 flex flex-col gap-1">
|
|
528
|
+
<span class="text-xs text-slate-400 font-medium">Avg Duration</span>
|
|
529
|
+
<span class="text-2xl font-bold text-indigo-300 font-mono">{data.avgDurationMs} ms</span>
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
|
|
533
|
+
<div class="p-4 rounded-xl bg-slate-900/60 border border-slate-800 flex flex-col gap-3">
|
|
534
|
+
<span class="text-xs font-semibold text-slate-300 uppercase tracking-wider">Process Info</span>
|
|
535
|
+
<div class="grid grid-cols-2 gap-4 text-xs font-mono">
|
|
536
|
+
<div class="flex items-center justify-between p-2 rounded bg-slate-950 border border-slate-850">
|
|
537
|
+
<span class="text-slate-400">PID:</span>
|
|
538
|
+
<span class="text-slate-200">{data.serverPid}</span>
|
|
539
|
+
</div>
|
|
540
|
+
<div class="flex items-center justify-between p-2 rounded bg-slate-950 border border-slate-850">
|
|
541
|
+
<span class="text-slate-400">Uptime:</span>
|
|
542
|
+
<span class="text-slate-200">{data.serverUptime}s</span>
|
|
543
|
+
</div>
|
|
544
|
+
</div>
|
|
545
|
+
</div>
|
|
546
|
+
|
|
547
|
+
<div class="flex items-center gap-3 pt-2">
|
|
548
|
+
<a href="/metrics" target="_blank" class="px-3.5 py-2 bg-slate-900 hover:bg-slate-800 text-slate-200 text-xs font-medium rounded-lg border border-slate-800 transition-colors">
|
|
549
|
+
Open Raw Prometheus (/metrics)
|
|
550
|
+
</a>
|
|
551
|
+
<a href="/analytics" target="_blank" class="px-3.5 py-2 bg-slate-900 hover:bg-slate-800 text-slate-200 text-xs font-medium rounded-lg border border-slate-800 transition-colors">
|
|
552
|
+
Open JSON Analytics (/analytics)
|
|
553
|
+
</a>
|
|
554
|
+
<a href="/inspect/api/state" target="_blank" class="px-3.5 py-2 bg-slate-900 hover:bg-slate-800 text-slate-200 text-xs font-medium rounded-lg border border-slate-800 transition-colors">
|
|
555
|
+
Open State JSON (/inspect/api/state)
|
|
556
|
+
</a>
|
|
557
|
+
</div>
|
|
558
|
+
</div>
|
|
559
|
+
</main>
|
|
560
|
+
</div>
|
|
561
|
+
</div>
|
|
562
|
+
</uid_spec>
|
|
563
|
+
</script>
|
|
564
|
+
|
|
565
|
+
<script>
|
|
566
|
+
(function() {
|
|
567
|
+
function bootstrap() {
|
|
568
|
+
var specEl = document.getElementById('euix-spec');
|
|
569
|
+
if (!specEl) return;
|
|
570
|
+
var xml = specEl.textContent || specEl.innerText;
|
|
571
|
+
var container = document.getElementById('app');
|
|
572
|
+
|
|
573
|
+
var engine = window.EUIXEngine && (window.EUIXEngine.EUIXEngine || window.EUIXEngine.default || window.EUIXEngine);
|
|
574
|
+
if (engine && typeof engine.mount === 'function') {
|
|
575
|
+
container.innerHTML = '';
|
|
576
|
+
try {
|
|
577
|
+
engine.mount(xml, container);
|
|
578
|
+
} catch (err) {
|
|
579
|
+
console.error('EUIX mount error:', err);
|
|
580
|
+
container.innerHTML = '<div class="p-8 text-rose-400 font-mono text-sm">Failed to mount EUIX Engine: ' + err.message + '</div>';
|
|
581
|
+
}
|
|
582
|
+
} else {
|
|
583
|
+
console.warn('EUIXEngine not found on window');
|
|
584
|
+
var loadingEl = document.getElementById('fallback-loading');
|
|
585
|
+
if (loadingEl) {
|
|
586
|
+
loadingEl.innerHTML = '<div class="p-6 text-center text-slate-300 font-sans">' +
|
|
587
|
+
'<div class="text-base font-semibold text-amber-400 mb-2">EUIX Engine CDN Offline or Blocked</div>' +
|
|
588
|
+
'<p class="text-xs text-slate-400 max-w-md mx-auto">Inspector UI requires unpkg CDN to load EUIXEngine.umd.js. Check network connection or proxy settings.</p>' +
|
|
589
|
+
'<div class="mt-4"><a href="/inspect/api/state" class="px-3 py-1.5 bg-slate-800 hover:bg-slate-700 text-slate-200 rounded text-xs">View Raw JSON State (/inspect/api/state)</a></div>' +
|
|
590
|
+
'</div>';
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (document.readyState === 'loading') {
|
|
596
|
+
document.addEventListener('DOMContentLoaded', bootstrap);
|
|
597
|
+
} else {
|
|
598
|
+
bootstrap();
|
|
599
|
+
}
|
|
600
|
+
})();
|
|
674
601
|
</script>
|
|
675
602
|
</body>
|
|
676
603
|
</html>`;
|