@trops/dash-core 0.1.448 → 0.1.449

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,16 +45894,47 @@ 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
+ });
45875
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();
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]);
@@ -46417,6 +46479,10 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
46417
46479
  }), /*#__PURE__*/jsx("span", {
46418
46480
  className: "font-semibold text-lg",
46419
46481
  children: server.name
46482
+ }), server._external && /*#__PURE__*/jsx("span", {
46483
+ className: "ml-auto text-xs px-2 py-0.5 rounded bg-indigo-900 text-indigo-200",
46484
+ title: "From the curated known-external allow-list (github.com/modelcontextprotocol/servers). Installs the same way as built-in entries.",
46485
+ children: "external"
46420
46486
  })]
46421
46487
  }), /*#__PURE__*/jsx("p", {
46422
46488
  className: "text-sm opacity-70 mb-3",