agent-discover 1.0.2 → 1.0.4

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/dist/ui/app.js CHANGED
@@ -174,8 +174,16 @@
174
174
 
175
175
  var html = state.servers
176
176
  .map(function (s) {
177
- var statusClass = s.active ? 'active' : 'inactive';
178
- var statusLabel = s.active ? 'Active' : 'Inactive';
177
+ var statusClass = s.active
178
+ ? s.health_status === 'unhealthy'
179
+ ? 'unhealthy'
180
+ : 'active'
181
+ : 'inactive';
182
+ var statusLabel = s.active
183
+ ? s.health_status === 'unhealthy'
184
+ ? 'Unhealthy'
185
+ : 'Active'
186
+ : 'Inactive';
179
187
 
180
188
  // Approval badge
181
189
  var approval = s.approval_status || 'experimental';
@@ -204,14 +212,8 @@
204
212
  approvalDropdown +
205
213
  '</span>';
206
214
 
207
- // Health dot
215
+ // Combined status: active+healthy=green, active+unhealthy=red, inactive=gray
208
216
  var healthStatus = s.health_status || 'unknown';
209
- var healthDot =
210
- '<span class="health-dot health-' +
211
- esc(healthStatus) +
212
- '" title="Health: ' +
213
- esc(healthStatus) +
214
- '"></span>';
215
217
 
216
218
  // Error count
217
219
  var errorCount =
@@ -287,7 +289,6 @@
287
289
  '</div>' +
288
290
  '<div style="display:flex;align-items:center;gap:8px">' +
289
291
  errorCount +
290
- healthDot +
291
292
  '<span class="server-status"><span class="status-dot ' +
292
293
  statusClass +
293
294
  '"></span>' +
@@ -494,7 +495,12 @@
494
495
  '<div class="empty-state"><span class="material-symbols-outlined empty-icon">explore</span><p>Search the official MCP registry</p><p class="hint">Type a query above to discover servers</p></div>';
495
496
  } else {
496
497
  el.innerHTML =
497
- '<div class="empty-state"><span class="material-symbols-outlined empty-icon">search_off</span><p>No results found</p></div>';
498
+ '<div class="empty-state"><span class="material-symbols-outlined empty-icon">search_off</span><p>No results in MCP registry</p>' +
499
+ '<p class="hint">Install from npm directly:</p>' +
500
+ '<div class="npm-install-form">' +
501
+ '<input type="text" id="npm-package-input" placeholder="npm package (e.g. @modelcontextprotocol/server-everything)" />' +
502
+ '<button class="btn-install" onclick="window.__installFromNpm()"><span class="material-symbols-outlined" style="font-size:14px">download</span> Install</button>' +
503
+ '</div></div>';
498
504
  }
499
505
  return;
500
506
  }
@@ -642,6 +648,38 @@
642
648
  });
643
649
  };
644
650
 
651
+ window.__installFromNpm = function () {
652
+ var input = document.getElementById('npm-package-input');
653
+ var pkg = (input ? input.value : '').trim();
654
+ if (!pkg) return;
655
+
656
+ var safeName = pkg.replace(/@/g, '').replace(/\//g, '-');
657
+ fetch('/api/servers', {
658
+ method: 'POST',
659
+ headers: { 'Content-Type': 'application/json' },
660
+ body: JSON.stringify({
661
+ name: safeName,
662
+ command: 'npx',
663
+ args: ['-y', pkg],
664
+ description: 'Installed from npm: ' + pkg,
665
+ source: 'registry',
666
+ tags: ['npm'],
667
+ }),
668
+ })
669
+ .then(function (r) {
670
+ if (!r.ok) throw new Error('Install failed');
671
+ return r.json();
672
+ })
673
+ .then(function () {
674
+ showToast('Installed ' + pkg, 'success');
675
+ if (input) input.value = '';
676
+ })
677
+ .catch(function (err) {
678
+ console.error('npm install failed:', err);
679
+ showToast('Install failed: ' + err.message, 'error');
680
+ });
681
+ };
682
+
645
683
  // -------------------------------------------------------------------------
646
684
  // Enterprise feature actions
647
685
  // -------------------------------------------------------------------------
@@ -364,6 +364,10 @@ body {
364
364
  background: var(--status-inactive);
365
365
  }
366
366
 
367
+ .status-dot.unhealthy {
368
+ background: #f44336;
369
+ }
370
+
367
371
  .server-description {
368
372
  font-size: 13px;
369
373
  color: var(--text-secondary);
@@ -479,6 +483,33 @@ body {
479
483
  margin-top: 4px;
480
484
  }
481
485
 
486
+ .npm-install-form {
487
+ display: flex;
488
+ gap: 8px;
489
+ margin-top: 12px;
490
+ max-width: 500px;
491
+ }
492
+
493
+ .npm-install-form input {
494
+ flex: 1;
495
+ background: var(--bg);
496
+ border: 1px solid var(--border);
497
+ border-radius: 6px;
498
+ padding: 8px 12px;
499
+ color: var(--text);
500
+ font-family: var(--font-mono);
501
+ font-size: 12px;
502
+ }
503
+
504
+ .npm-install-form input:focus {
505
+ outline: none;
506
+ border-color: var(--accent);
507
+ }
508
+
509
+ .npm-install-form .btn-install {
510
+ flex-shrink: 0;
511
+ }
512
+
482
513
  /* ---------------------------------------------------------------------------
483
514
  Buttons
484
515
  --------------------------------------------------------------------------- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-discover",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "mcpName": "io.github.keshrath/agent-discover",
5
5
  "description": "MCP server registry and marketplace — discover, install, activate, and manage MCP tools on demand",
6
6
  "type": "module",