agent-discover 1.0.3 → 1.0.5

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
@@ -185,32 +185,7 @@
185
185
  : 'Active'
186
186
  : 'Inactive';
187
187
 
188
- // Approval badge
189
- var approval = s.approval_status || 'experimental';
190
- var approvalDropdown = '';
191
- if (openApprovalDropdown === s.id) {
192
- approvalDropdown =
193
- '<div class="approval-dropdown">' +
194
- '<button class="approval-dropdown-item" onclick="window.__setApproval(' +
195
- s.id +
196
- ", 'experimental')\">experimental</button>" +
197
- '<button class="approval-dropdown-item" onclick="window.__setApproval(' +
198
- s.id +
199
- ", 'approved')\">approved</button>" +
200
- '<button class="approval-dropdown-item" onclick="window.__setApproval(' +
201
- s.id +
202
- ", 'production')\">production</button>" +
203
- '</div>';
204
- }
205
- var approvalBadge =
206
- '<span class="approval-badge approval-' +
207
- esc(approval) +
208
- '" style="position:relative" onclick="window.__toggleApprovalDropdown(' +
209
- s.id +
210
- ')">' +
211
- esc(approval) +
212
- approvalDropdown +
213
- '</span>';
188
+ // Approval badge removed — not useful without automatic classification
214
189
 
215
190
  // Combined status: active+healthy=green, active+unhealthy=red, inactive=gray
216
191
  var healthStatus = s.health_status || 'unknown';
@@ -285,7 +260,6 @@
285
260
  '<span class="server-name">' +
286
261
  esc(s.name) +
287
262
  '</span>' +
288
- approvalBadge +
289
263
  '</div>' +
290
264
  '<div style="display:flex;align-items:center;gap:8px">' +
291
265
  errorCount +
@@ -496,8 +470,11 @@
496
470
  } else {
497
471
  el.innerHTML =
498
472
  '<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">Know the npm package? Install via MCP tool:</p>' +
500
- '<code class="hint-code">registry({ action: "install", name: "my-server", command: "npx", args: ["-y", "@scope/package"] })</code></div>';
473
+ "<a class=\"hint-link\" onclick=\"this.nextElementSibling.style.display='flex';this.style.display='none'\">Can't find it? Install from npm</a>" +
474
+ '<div class="npm-install-form" style="display:none">' +
475
+ '<input type="text" id="npm-package-input" placeholder="npm package name (e.g. @modelcontextprotocol/server-everything)" />' +
476
+ '<button class="btn-install" onclick="window.__installFromNpm()"><span class="material-symbols-outlined" style="font-size:14px">download</span> Install</button>' +
477
+ '</div></div>';
501
478
  }
502
479
  return;
503
480
  }
@@ -614,12 +591,20 @@
614
591
  '<span class="material-symbols-outlined" style="font-size:14px">hourglass_top</span>Installing...';
615
592
 
616
593
  var safeName = (server.name || '').replace(/\//g, '-');
594
+ var npmPkg = safeName;
595
+ // Try to derive npm package name from registry name (e.g. "io.github.user/pkg" -> "@user/pkg")
596
+ var parts = (server.name || '').split('/');
597
+ if (parts.length >= 2) {
598
+ npmPkg = parts[parts.length - 1];
599
+ }
617
600
  fetch('/api/servers', {
618
601
  method: 'POST',
619
602
  headers: { 'Content-Type': 'application/json' },
620
603
  body: JSON.stringify({
621
604
  name: safeName,
622
605
  description: server.description || '',
606
+ command: 'npx',
607
+ args: ['-y', server.name || npmPkg],
623
608
  source: 'registry',
624
609
  tags: ['marketplace'],
625
610
  }),
@@ -645,6 +630,38 @@
645
630
  });
646
631
  };
647
632
 
633
+ window.__installFromNpm = function () {
634
+ var input = document.getElementById('npm-package-input');
635
+ var pkg = (input ? input.value : '').trim();
636
+ if (!pkg) return;
637
+
638
+ var safeName = pkg.replace(/@/g, '').replace(/\//g, '-');
639
+ fetch('/api/servers', {
640
+ method: 'POST',
641
+ headers: { 'Content-Type': 'application/json' },
642
+ body: JSON.stringify({
643
+ name: safeName,
644
+ command: 'npx',
645
+ args: ['-y', pkg],
646
+ description: 'Installed from npm: ' + pkg,
647
+ source: 'registry',
648
+ tags: ['npm'],
649
+ }),
650
+ })
651
+ .then(function (r) {
652
+ if (!r.ok) throw new Error('Install failed');
653
+ return r.json();
654
+ })
655
+ .then(function () {
656
+ showToast('Installed ' + pkg, 'success');
657
+ if (input) input.value = '';
658
+ })
659
+ .catch(function (err) {
660
+ console.error('npm install failed:', err);
661
+ showToast('Install failed: ' + err.message, 'error');
662
+ });
663
+ };
664
+
648
665
  // -------------------------------------------------------------------------
649
666
  // Enterprise feature actions
650
667
  // -------------------------------------------------------------------------
@@ -483,16 +483,42 @@ body {
483
483
  margin-top: 4px;
484
484
  }
485
485
 
486
- .hint-code {
487
- display: block;
486
+ .hint-link {
487
+ color: var(--accent);
488
+ cursor: pointer;
489
+ font-size: 13px;
488
490
  margin-top: 8px;
489
- font-family: var(--font-mono);
490
- font-size: 11px;
491
- background: var(--bg-elevated);
492
- padding: 8px 12px;
491
+ }
492
+
493
+ .hint-link:hover {
494
+ text-decoration: underline;
495
+ }
496
+
497
+ .npm-install-form {
498
+ display: flex;
499
+ gap: 8px;
500
+ margin-top: 12px;
501
+ max-width: 500px;
502
+ }
503
+
504
+ .npm-install-form input {
505
+ flex: 1;
506
+ background: var(--bg);
507
+ border: 1px solid var(--border);
493
508
  border-radius: 6px;
494
- color: var(--accent);
495
- word-break: break-all;
509
+ padding: 8px 12px;
510
+ color: var(--text);
511
+ font-family: var(--font-mono);
512
+ font-size: 12px;
513
+ }
514
+
515
+ .npm-install-form input:focus {
516
+ outline: none;
517
+ border-color: var(--accent);
518
+ }
519
+
520
+ .npm-install-form .btn-install {
521
+ flex-shrink: 0;
496
522
  }
497
523
 
498
524
  /* ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-discover",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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",