agent-discover 1.0.13 → 1.0.14

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.
@@ -2,7 +2,7 @@
2
2
  "id": "agent-discover",
3
3
  "name": "Discover",
4
4
  "icon": "explore",
5
- "version": "1.0.13",
5
+ "version": "1.0.14",
6
6
  "description": "MCP server registry — browse, install, configure, monitor",
7
7
  "ui": "./dist/ui/app.js",
8
8
  "css": "./dist/ui/styles.css",
package/dist/ui/app.js CHANGED
@@ -236,24 +236,24 @@
236
236
  : '';
237
237
 
238
238
  var actionBtn = s.active
239
- ? '<button class="btn-deactivate" onclick="window.__deactivateServer(' +
239
+ ? '<button class="btn-deactivate" data-action="deactivate" data-id="' +
240
240
  s.id +
241
- ')"><span class="material-symbols-outlined" style="font-size:14px">stop_circle</span>Deactivate</button>'
242
- : '<button class="btn-activate" onclick="window.__activateServer(' +
241
+ '"><span class="material-symbols-outlined" style="font-size:14px">stop_circle</span>Deactivate</button>'
242
+ : '<button class="btn-activate" data-action="activate" data-id="' +
243
243
  s.id +
244
- ')"><span class="material-symbols-outlined" style="font-size:14px">play_circle</span>Activate</button>';
244
+ '"><span class="material-symbols-outlined" style="font-size:14px">play_circle</span>Activate</button>';
245
245
 
246
246
  var healthBtn =
247
- '<button class="btn-health" onclick="window.__checkHealth(' +
247
+ '<button class="btn-health" data-action="health" data-id="' +
248
248
  s.id +
249
- ')"><span class="material-symbols-outlined" style="font-size:14px">favorite</span>Check Health</button>';
249
+ '"><span class="material-symbols-outlined" style="font-size:14px">favorite</span>Check Health</button>';
250
250
 
251
251
  var deleteBtn =
252
- '<button class="btn-delete" onclick="window.__deleteServer(' +
252
+ '<button class="btn-delete" data-action="delete" data-id="' +
253
253
  s.id +
254
- ", '" +
255
- esc(s.name).replace(/'/g, "\\'") +
256
- '\')"><span class="material-symbols-outlined" style="font-size:14px">delete</span>Delete</button>';
254
+ '" data-name="' +
255
+ escAttr(s.name) +
256
+ '"><span class="material-symbols-outlined" style="font-size:14px">delete</span>Delete</button>';
257
257
 
258
258
  var actionsSection =
259
259
  '<div class="server-actions">' + actionBtn + healthBtn + deleteBtn + '</div>';
@@ -324,11 +324,11 @@
324
324
  '<div class="server-section">' +
325
325
  '<button class="section-toggle' +
326
326
  (isOpen ? ' open' : '') +
327
- '" onclick="window.__toggleSection(' +
327
+ '" data-action="toggle-section" data-id="' +
328
328
  serverId +
329
- ", '" +
329
+ '" data-section="' +
330
330
  name +
331
- '\')">' +
331
+ '">' +
332
332
  '<span class="material-symbols-outlined">chevron_right</span>' +
333
333
  esc(label) +
334
334
  '</button>' +
@@ -362,11 +362,11 @@
362
362
  '<span class="secret-value">' +
363
363
  esc(s.masked_value || '********') +
364
364
  '</span>' +
365
- '<button class="secret-delete" onclick="window.__deleteSecret(' +
365
+ '<button class="secret-delete" data-action="delete-secret" data-id="' +
366
366
  server.id +
367
- ", '" +
368
- esc(s.key).replace(/'/g, "\\'") +
369
- '\')" title="Delete secret">' +
367
+ '" data-key="' +
368
+ escAttr(s.key) +
369
+ '" title="Delete secret">' +
370
370
  '<span class="material-symbols-outlined" style="font-size:14px">close</span>' +
371
371
  '</button>' +
372
372
  '</div>'
@@ -382,9 +382,9 @@
382
382
  '<input type="password" placeholder="Value" id="secret-val-' +
383
383
  server.id +
384
384
  '" />' +
385
- '<button onclick="window.__addSecret(' +
385
+ '<button data-action="add-secret" data-id="' +
386
386
  server.id +
387
- ')">Save</button>' +
387
+ '">Save</button>' +
388
388
  '</div>';
389
389
 
390
390
  return items + addForm;
@@ -471,9 +471,9 @@
471
471
  .join('\n'),
472
472
  ) +
473
473
  '</textarea></div>' +
474
- '<button class="config-save" onclick="window.__saveConfig(' +
474
+ '<button class="config-save" data-action="save-config" data-id="' +
475
475
  server.id +
476
- ')">Save Config</button>' +
476
+ '">Save Config</button>' +
477
477
  '</div>'
478
478
  );
479
479
  }
@@ -488,10 +488,10 @@
488
488
  } else {
489
489
  el.innerHTML =
490
490
  '<div class="empty-state"><span class="material-symbols-outlined empty-icon">search_off</span><p>No results in MCP registry</p>' +
491
- "<a class=\"hint-link\" onclick=\"this.nextElementSibling.style.display='flex';this.style.display='none'\">Can't find it? Install from npm</a>" +
491
+ '<a class="hint-link" data-action="show-npm-form">Can\'t find it? Install from npm</a>' +
492
492
  '<div class="npm-install-form" style="display:none">' +
493
493
  '<input type="text" id="npm-package-input" placeholder="npm package name (e.g. @modelcontextprotocol/server-everything)" />' +
494
- '<button class="btn-install" onclick="window.__installFromNpm()"><span class="material-symbols-outlined" style="font-size:14px">download</span> Install</button>' +
494
+ '<button class="btn-install" data-action="install-npm"><span class="material-symbols-outlined" style="font-size:14px">download</span> Install</button>' +
495
495
  '</div></div>';
496
496
  }
497
497
  return;
@@ -542,11 +542,9 @@
542
542
  '<button class="btn-install" disabled title="Remote server — not supported for local activation"><span class="material-symbols-outlined" style="font-size:14px">cloud_off</span>Remote only</button>';
543
543
  } else {
544
544
  installBtn =
545
- '<button class="btn-install" data-browse-idx="' +
546
- idx +
547
- '" onclick="window.__installFromBrowse(' +
545
+ '<button class="btn-install" data-action="install-browse" data-browse-idx="' +
548
546
  idx +
549
- ', this)"><span class="material-symbols-outlined" style="font-size:14px">download</span>Install</button>';
547
+ '"><span class="material-symbols-outlined" style="font-size:14px">download</span>Install</button>';
550
548
  }
551
549
 
552
550
  return (
@@ -972,10 +970,68 @@
972
970
  // Init
973
971
  // -------------------------------------------------------------------------
974
972
 
973
+ function _initDelegatedClicks() {
974
+ var root =
975
+ AD._root.getElementById('server-list') ||
976
+ AD._root.getElementById('tab-installed') ||
977
+ AD._root.body ||
978
+ AD._root;
979
+ // Use a broad container — the main content area
980
+ var container =
981
+ AD._root.querySelector('.main-content') || AD._root.querySelector('.ad-wrapper') || AD._root;
982
+ container.addEventListener('click', function (e) {
983
+ var btn = e.target.closest('[data-action]');
984
+ if (!btn) return;
985
+ var action = btn.dataset.action;
986
+ var id = parseInt(btn.dataset.id, 10);
987
+
988
+ switch (action) {
989
+ case 'activate':
990
+ window.__activateServer(id);
991
+ break;
992
+ case 'deactivate':
993
+ window.__deactivateServer(id);
994
+ break;
995
+ case 'health':
996
+ window.__checkHealth(id);
997
+ break;
998
+ case 'delete':
999
+ window.__deleteServer(id, btn.dataset.name);
1000
+ break;
1001
+ case 'toggle-section':
1002
+ window.__toggleSection(id, btn.dataset.section);
1003
+ break;
1004
+ case 'delete-secret':
1005
+ window.__deleteSecret(id, btn.dataset.key);
1006
+ break;
1007
+ case 'add-secret':
1008
+ window.__addSecret(id);
1009
+ break;
1010
+ case 'save-config':
1011
+ window.__saveConfig(id);
1012
+ break;
1013
+ case 'install-npm':
1014
+ window.__installFromNpm();
1015
+ break;
1016
+ case 'install-browse':
1017
+ window.__installFromBrowse(parseInt(btn.dataset.browseIdx, 10), btn);
1018
+ break;
1019
+ case 'show-npm-form':
1020
+ var form = btn.nextElementSibling;
1021
+ if (form) {
1022
+ form.style.display = 'flex';
1023
+ btn.style.display = 'none';
1024
+ }
1025
+ break;
1026
+ }
1027
+ });
1028
+ }
1029
+
975
1030
  function _init() {
976
1031
  initTabs();
977
1032
  initTheme();
978
1033
  initSearch();
1034
+ _initDelegatedClicks();
979
1035
  connect();
980
1036
  initThemeSync();
981
1037
  }
@@ -1143,6 +1199,8 @@
1143
1199
 
1144
1200
  AD._root = shadow;
1145
1201
  _init();
1202
+ var themeBtn = shadow.getElementById('theme-toggle');
1203
+ if (themeBtn) themeBtn.style.display = 'none';
1146
1204
  };
1147
1205
 
1148
1206
  AD.unmount = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-discover",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
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",