@trops/dash-core 0.1.448 → 0.1.450

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/index.esm.js CHANGED
@@ -1788,16 +1788,47 @@ var ElectronDashboardApi = /*#__PURE__*/function () {
1788
1788
  return false;
1789
1789
  }
1790
1790
  }
1791
+ /**
1792
+ * Load the curated allow-list of MCP servers known to exist outside
1793
+ * the built-in catalog. Surfaced in Settings → Providers → Add MCP
1794
+ * alongside the built-in entries so users have one place to install
1795
+ * any catalog-listed provider, regardless of whether the AI Widget
1796
+ * Builder triggered it. Mirrors mcpGetCatalog's callback shape.
1797
+ */
1798
+ }, {
1799
+ key: "mcpGetKnownExternalCatalog",
1800
+ value: function mcpGetKnownExternalCatalog(onSuccess, onError) {
1801
+ var _this28 = this;
1802
+ if (this.api !== null) {
1803
+ try {
1804
+ this.api.mcp.getKnownExternalCatalog().then(function (result) {
1805
+ // Reuse the existing CATALOG_COMPLETE event — callers
1806
+ // discriminate via the `external: true` flag we add in
1807
+ // ProvidersSection / McpCatalogDetail when merging.
1808
+ onSuccess(_this28.events.MCP_GET_CATALOG_COMPLETE, result);
1809
+ })["catch"](function (error) {
1810
+ onError(_this28.events.MCP_GET_CATALOG_ERROR, error);
1811
+ });
1812
+ return true;
1813
+ } catch (e) {
1814
+ onError(this.events.MCP_GET_CATALOG_ERROR, e);
1815
+ return false;
1816
+ }
1817
+ } else {
1818
+ onError(this.events.MCP_GET_CATALOG_ERROR, new Error("No Api found"));
1819
+ return false;
1820
+ }
1821
+ }
1791
1822
  }, {
1792
1823
  key: "mcpRunAuth",
1793
1824
  value: function mcpRunAuth(mcpConfig, credentials, authCommand, onSuccess, onError) {
1794
- var _this28 = this;
1825
+ var _this29 = this;
1795
1826
  if (this.api !== null) {
1796
1827
  try {
1797
1828
  this.api.mcp.runAuth(mcpConfig, credentials, authCommand).then(function (result) {
1798
- onSuccess(_this28.events.MCP_RUN_AUTH_COMPLETE, result);
1829
+ onSuccess(_this29.events.MCP_RUN_AUTH_COMPLETE, result);
1799
1830
  })["catch"](function (error) {
1800
- onError(_this28.events.MCP_RUN_AUTH_ERROR, error);
1831
+ onError(_this29.events.MCP_RUN_AUTH_ERROR, error);
1801
1832
  });
1802
1833
  return true;
1803
1834
  } catch (e) {
@@ -45863,27 +45894,65 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
45863
45894
  return deriveFormFields(effectiveMcpConfig, selectedServer.credentialSchema || {});
45864
45895
  }, [selectedServer, effectiveMcpConfig]);
45865
45896
 
45866
- // Load catalog on mount
45897
+ // Load catalog on mount. Merges the built-in catalog (already-bundled
45898
+ // MCP servers) with the curated known-external allow-list so the user
45899
+ // sees everything in one place. Known-external entries are tagged
45900
+ // with `_external: true` so the UI can mark them visually.
45867
45901
  useEffect(function () {
45868
- if (dashApi && catalog.length === 0) {
45869
- setIsLoadingCatalog(true);
45870
- dashApi.mcpGetCatalog(function (event, result) {
45871
- setCatalog(result.catalog || []);
45872
- setIsLoadingCatalog(false);
45873
- }, function (event, err) {
45902
+ if (!dashApi || catalog.length > 0) return;
45903
+ setIsLoadingCatalog(true);
45904
+ var pending = 2;
45905
+ var merged = [];
45906
+ var finish = function finish() {
45907
+ if (--pending === 0) {
45908
+ setCatalog(merged);
45874
45909
  setIsLoadingCatalog(false);
45910
+ }
45911
+ };
45912
+ dashApi.mcpGetCatalog(function (_event, result) {
45913
+ var builtIn = (result.catalog || []).map(function (s) {
45914
+ return _objectSpread$n(_objectSpread$n({}, s), {}, {
45915
+ _external: false
45916
+ });
45917
+ });
45918
+ merged = merged.concat(builtIn);
45919
+ finish();
45920
+ }, function (_event, err) {
45921
+ finish();
45922
+ });
45923
+ if (typeof dashApi.mcpGetKnownExternalCatalog === "function") {
45924
+ dashApi.mcpGetKnownExternalCatalog(function (_event, result) {
45925
+ var external = (result.servers || []).map(function (s) {
45926
+ return _objectSpread$n(_objectSpread$n({}, s), {}, {
45927
+ _external: true
45928
+ });
45929
+ });
45930
+ merged = merged.concat(external);
45931
+ finish();
45932
+ }, function (_event, err) {
45933
+ finish();
45875
45934
  });
45935
+ } else {
45936
+ // Older dashApi without known-external support — skip cleanly.
45937
+ finish();
45876
45938
  }
45877
45939
  // eslint-disable-next-line react-hooks/exhaustive-deps
45878
45940
  }, [dashApi]);
45879
45941
 
45880
- // Filter catalog by search
45942
+ // Filter catalog by search, then sort alphabetically by display name.
45943
+ // Built-in and known-external entries are interleaved alphabetically —
45944
+ // the per-card "external" badge keeps the source obvious without
45945
+ // needing a separate group header.
45881
45946
  var filteredCatalog = catalog.filter(function (server) {
45882
45947
  if (!searchQuery) return true;
45883
45948
  var q = searchQuery.toLowerCase();
45884
45949
  return server.name.toLowerCase().includes(q) || server.description.toLowerCase().includes(q) || (server.tags || []).some(function (tag) {
45885
45950
  return tag.toLowerCase().includes(q);
45886
45951
  });
45952
+ }).slice().sort(function (a, b) {
45953
+ return String(a.name || "").localeCompare(String(b.name || ""), undefined, {
45954
+ sensitivity: "base"
45955
+ });
45887
45956
  });
45888
45957
 
45889
45958
  // Dynamic wizard steps based on whether auth is needed
@@ -46417,6 +46486,10 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
46417
46486
  }), /*#__PURE__*/jsx("span", {
46418
46487
  className: "font-semibold text-lg",
46419
46488
  children: server.name
46489
+ }), server._external && /*#__PURE__*/jsx("span", {
46490
+ className: "ml-auto text-xs px-2 py-0.5 rounded bg-indigo-900 text-indigo-200",
46491
+ title: "From the curated known-external allow-list (github.com/modelcontextprotocol/servers). Installs the same way as built-in entries.",
46492
+ children: "external"
46420
46493
  })]
46421
46494
  }), /*#__PURE__*/jsx("p", {
46422
46495
  className: "text-sm opacity-70 mb-3",