@trops/dash-core 0.1.54 → 0.1.56
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/electron/index.js +78 -8
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +279 -109
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +280 -108
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcpServerCatalog.json +329 -345
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -691,6 +691,8 @@ var MCP_SERVER_STATUS_COMPLETE = "mcp:server-status:complete";
|
|
|
691
691
|
var MCP_SERVER_STATUS_ERROR = "mcp:server-status:error";
|
|
692
692
|
var MCP_GET_CATALOG_COMPLETE = "mcp:get-catalog:complete";
|
|
693
693
|
var MCP_GET_CATALOG_ERROR = "mcp:get-catalog:error";
|
|
694
|
+
var MCP_RUN_AUTH_COMPLETE = "mcp:run-auth:complete";
|
|
695
|
+
var MCP_RUN_AUTH_ERROR = "mcp:run-auth:error";
|
|
694
696
|
|
|
695
697
|
var DATA_JSON_TO_CSV_FILE = "data-json-to-csv-file";
|
|
696
698
|
var DATA_JSON_TO_CSV_FILE_COMPLETE = "data-json-to-csv-file-complete";
|
|
@@ -799,6 +801,8 @@ var apiEvents = /*#__PURE__*/Object.freeze({
|
|
|
799
801
|
MCP_LIST_TOOLS_ERROR: MCP_LIST_TOOLS_ERROR,
|
|
800
802
|
MCP_READ_RESOURCE_COMPLETE: MCP_READ_RESOURCE_COMPLETE,
|
|
801
803
|
MCP_READ_RESOURCE_ERROR: MCP_READ_RESOURCE_ERROR,
|
|
804
|
+
MCP_RUN_AUTH_COMPLETE: MCP_RUN_AUTH_COMPLETE,
|
|
805
|
+
MCP_RUN_AUTH_ERROR: MCP_RUN_AUTH_ERROR,
|
|
802
806
|
MCP_SERVER_STATUS_COMPLETE: MCP_SERVER_STATUS_COMPLETE,
|
|
803
807
|
MCP_SERVER_STATUS_ERROR: MCP_SERVER_STATUS_ERROR,
|
|
804
808
|
MCP_START_SERVER_COMPLETE: MCP_START_SERVER_COMPLETE,
|
|
@@ -1497,6 +1501,27 @@ var ElectronDashboardApi = /*#__PURE__*/function () {
|
|
|
1497
1501
|
return false;
|
|
1498
1502
|
}
|
|
1499
1503
|
}
|
|
1504
|
+
}, {
|
|
1505
|
+
key: "mcpRunAuth",
|
|
1506
|
+
value: function mcpRunAuth(mcpConfig, credentials, authCommand, onSuccess, onError) {
|
|
1507
|
+
var _this26 = this;
|
|
1508
|
+
if (this.api !== null) {
|
|
1509
|
+
try {
|
|
1510
|
+
this.api.mcp.runAuth(mcpConfig, credentials, authCommand).then(function (result) {
|
|
1511
|
+
onSuccess(_this26.events.MCP_RUN_AUTH_COMPLETE, result);
|
|
1512
|
+
})["catch"](function (error) {
|
|
1513
|
+
onError(_this26.events.MCP_RUN_AUTH_ERROR, error);
|
|
1514
|
+
});
|
|
1515
|
+
return true;
|
|
1516
|
+
} catch (e) {
|
|
1517
|
+
onError(this.events.MCP_RUN_AUTH_ERROR, e);
|
|
1518
|
+
return false;
|
|
1519
|
+
}
|
|
1520
|
+
} else {
|
|
1521
|
+
onError(this.events.MCP_RUN_AUTH_ERROR, new Error("No Api found"));
|
|
1522
|
+
return false;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1500
1525
|
}]);
|
|
1501
1526
|
}();
|
|
1502
1527
|
|
|
@@ -25868,7 +25893,7 @@ var FoldersSection = function FoldersSection(_ref) {
|
|
|
25868
25893
|
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25869
25894
|
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25870
25895
|
var ProviderDetail = function ProviderDetail(_ref) {
|
|
25871
|
-
var _testResult$tools;
|
|
25896
|
+
var _provider$mcpConfig, _testResult$tools;
|
|
25872
25897
|
var _ref$providerName = _ref.providerName,
|
|
25873
25898
|
providerName = _ref$providerName === void 0 ? null : _ref$providerName,
|
|
25874
25899
|
_ref$provider = _ref.provider,
|
|
@@ -25890,7 +25915,9 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
25890
25915
|
onCancelEdit = _ref.onCancelEdit,
|
|
25891
25916
|
onStartEdit = _ref.onStartEdit,
|
|
25892
25917
|
onCreate = _ref.onCreate,
|
|
25893
|
-
onDelete = _ref.onDelete
|
|
25918
|
+
onDelete = _ref.onDelete,
|
|
25919
|
+
_ref$catalogAuthComma = _ref.catalogAuthCommand,
|
|
25920
|
+
catalogAuthCommand = _ref$catalogAuthComma === void 0 ? null : _ref$catalogAuthComma;
|
|
25894
25921
|
var appContext = React.useContext(AppContext);
|
|
25895
25922
|
var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
|
|
25896
25923
|
var isMcp = (provider === null || provider === void 0 ? void 0 : provider.providerClass) === "mcp";
|
|
@@ -25905,6 +25932,19 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
25905
25932
|
testResult = _useState4[0],
|
|
25906
25933
|
setTestResult = _useState4[1];
|
|
25907
25934
|
|
|
25935
|
+
// MCP auth state
|
|
25936
|
+
var _useState5 = React.useState(false),
|
|
25937
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
25938
|
+
isAuthorizing = _useState6[0],
|
|
25939
|
+
setIsAuthorizing = _useState6[1];
|
|
25940
|
+
var _useState7 = React.useState(null),
|
|
25941
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
25942
|
+
authResult = _useState8[0],
|
|
25943
|
+
setAuthResult = _useState8[1];
|
|
25944
|
+
|
|
25945
|
+
// Resolve authCommand: provider.mcpConfig.authCommand > catalogAuthCommand prop
|
|
25946
|
+
var resolvedAuthCommand = (provider === null || provider === void 0 || (_provider$mcpConfig = provider.mcpConfig) === null || _provider$mcpConfig === void 0 ? void 0 : _provider$mcpConfig.authCommand) || catalogAuthCommand || null;
|
|
25947
|
+
|
|
25908
25948
|
// Derive credential fields for MCP providers in edit mode
|
|
25909
25949
|
var mcpFormFields = React.useMemo(function () {
|
|
25910
25950
|
if (!isMcp || !(provider !== null && provider !== void 0 && provider.mcpConfig)) return [];
|
|
@@ -25918,14 +25958,14 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
25918
25958
|
}, [isMcp, provider]);
|
|
25919
25959
|
|
|
25920
25960
|
// Dynamic credential fields for create mode
|
|
25921
|
-
var
|
|
25961
|
+
var _useState9 = React.useState(isCreating ? [{
|
|
25922
25962
|
id: "default_apiKey",
|
|
25923
25963
|
key: "apiKey",
|
|
25924
25964
|
secret: true
|
|
25925
25965
|
}] : []),
|
|
25926
|
-
|
|
25927
|
-
credentialFields =
|
|
25928
|
-
setCredentialFields =
|
|
25966
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
25967
|
+
credentialFields = _useState0[0],
|
|
25968
|
+
setCredentialFields = _useState0[1];
|
|
25929
25969
|
var fieldIdRef = React.useRef(0);
|
|
25930
25970
|
var handleFieldKeyChange = function handleFieldKeyChange(id, newKey) {
|
|
25931
25971
|
setCredentialFields(function (prev) {
|
|
@@ -26028,6 +26068,31 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
26028
26068
|
setIsTesting(false);
|
|
26029
26069
|
});
|
|
26030
26070
|
};
|
|
26071
|
+
var handleAuthorize = function handleAuthorize() {
|
|
26072
|
+
if (!dashApi || !(provider !== null && provider !== void 0 && provider.mcpConfig) || !resolvedAuthCommand) return;
|
|
26073
|
+
setIsAuthorizing(true);
|
|
26074
|
+
setAuthResult(null);
|
|
26075
|
+
dashApi.mcpRunAuth(provider.mcpConfig, provider.credentials, resolvedAuthCommand, function (event, result) {
|
|
26076
|
+
if (result.error) {
|
|
26077
|
+
setAuthResult({
|
|
26078
|
+
success: false,
|
|
26079
|
+
message: result.message
|
|
26080
|
+
});
|
|
26081
|
+
} else {
|
|
26082
|
+
setAuthResult({
|
|
26083
|
+
success: true,
|
|
26084
|
+
message: "Authorized!"
|
|
26085
|
+
});
|
|
26086
|
+
}
|
|
26087
|
+
setIsAuthorizing(false);
|
|
26088
|
+
}, function (event, err) {
|
|
26089
|
+
setAuthResult({
|
|
26090
|
+
success: false,
|
|
26091
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || "Authorization failed"
|
|
26092
|
+
});
|
|
26093
|
+
setIsAuthorizing(false);
|
|
26094
|
+
});
|
|
26095
|
+
};
|
|
26031
26096
|
var isFormMode = isEditing || isCreating;
|
|
26032
26097
|
|
|
26033
26098
|
// ── MCP config info block (shared between read-only view and edit form) ──
|
|
@@ -26081,7 +26146,7 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
26081
26146
|
|
|
26082
26147
|
// ── Edit / Create form ──
|
|
26083
26148
|
if (isFormMode) {
|
|
26084
|
-
var _provider$
|
|
26149
|
+
var _provider$mcpConfig2;
|
|
26085
26150
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26086
26151
|
className: "flex flex-col flex-1 min-h-0",
|
|
26087
26152
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -26178,7 +26243,7 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
26178
26243
|
className: "border-t border-white/10 pt-4",
|
|
26179
26244
|
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
26180
26245
|
className: "text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
26181
|
-
children: ((_provider$
|
|
26246
|
+
children: ((_provider$mcpConfig2 = provider.mcpConfig) === null || _provider$mcpConfig2 === void 0 ? void 0 : _provider$mcpConfig2.transport) === "streamable_http" ? "Server Configuration" : "Authentication"
|
|
26182
26247
|
})
|
|
26183
26248
|
}), mcpFormFields.map(function (field) {
|
|
26184
26249
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -26189,13 +26254,38 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
26189
26254
|
}), field.instructions && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
26190
26255
|
className: "text-sm opacity-50",
|
|
26191
26256
|
children: field.instructions
|
|
26192
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26196
|
-
|
|
26197
|
-
|
|
26198
|
-
|
|
26257
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26258
|
+
className: "flex gap-2",
|
|
26259
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26260
|
+
className: "flex-1",
|
|
26261
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
26262
|
+
type: field.secret ? "password" : "text",
|
|
26263
|
+
value: formCredentials[field.key] || "",
|
|
26264
|
+
onChange: function onChange(value) {
|
|
26265
|
+
return handleCredentialChange(field.key, value);
|
|
26266
|
+
},
|
|
26267
|
+
placeholder: field.type === "file" ? "Select a file..." : "Enter ".concat(field.displayName.toLowerCase())
|
|
26268
|
+
})
|
|
26269
|
+
}), field.type === "file" && /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
26270
|
+
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
26271
|
+
var filepath;
|
|
26272
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
26273
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26274
|
+
case 0:
|
|
26275
|
+
_context.next = 1;
|
|
26276
|
+
return window.mainApi.dialog.chooseFile(true, ["json"]);
|
|
26277
|
+
case 1:
|
|
26278
|
+
filepath = _context.sent;
|
|
26279
|
+
if (filepath) handleCredentialChange(field.key, filepath);
|
|
26280
|
+
case 2:
|
|
26281
|
+
case "end":
|
|
26282
|
+
return _context.stop();
|
|
26283
|
+
}
|
|
26284
|
+
}, _callee);
|
|
26285
|
+
})),
|
|
26286
|
+
className: "px-3 py-1.5 text-sm rounded bg-white/10 hover:bg-white/20 transition-colors",
|
|
26287
|
+
children: "Browse"
|
|
26288
|
+
})]
|
|
26199
26289
|
})]
|
|
26200
26290
|
}, field.key);
|
|
26201
26291
|
})]
|
|
@@ -26315,6 +26405,16 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
26315
26405
|
})]
|
|
26316
26406
|
})]
|
|
26317
26407
|
})]
|
|
26408
|
+
}), authResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26409
|
+
className: "p-3 rounded-lg text-sm ".concat(authResult.success ? "bg-green-900/30 border border-green-700 text-green-300" : "bg-red-900/30 border border-red-700 text-red-300"),
|
|
26410
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26411
|
+
className: "flex items-center gap-2",
|
|
26412
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26413
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
26414
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
26415
|
+
children: authResult.message
|
|
26416
|
+
})]
|
|
26417
|
+
})
|
|
26318
26418
|
}), testResult && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26319
26419
|
className: "p-3 rounded-lg text-sm ".concat(testResult.success ? "bg-green-900/30 border border-green-700 text-green-300" : "bg-red-900/30 border border-red-700 text-red-300"),
|
|
26320
26420
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -26343,7 +26443,11 @@ var ProviderDetail = function ProviderDetail(_ref) {
|
|
|
26343
26443
|
})]
|
|
26344
26444
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26345
26445
|
className: "flex-shrink-0 flex flex-row justify-end gap-2 px-6 py-4 border-t border-white/10",
|
|
26346
|
-
children: [isMcp && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
26446
|
+
children: [isMcp && resolvedAuthCommand && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
26447
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
26448
|
+
onClick: handleAuthorize,
|
|
26449
|
+
size: "sm"
|
|
26450
|
+
}), isMcp && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
26347
26451
|
title: isTesting ? "Testing..." : "Test Connection",
|
|
26348
26452
|
onClick: handleTestConnection,
|
|
26349
26453
|
size: "sm"
|
|
@@ -27074,13 +27178,38 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27074
27178
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FormLabel, {
|
|
27075
27179
|
label: field.displayName,
|
|
27076
27180
|
required: field.required
|
|
27077
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
27078
|
-
|
|
27079
|
-
|
|
27080
|
-
|
|
27081
|
-
|
|
27082
|
-
|
|
27083
|
-
|
|
27181
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27182
|
+
className: "flex gap-2",
|
|
27183
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27184
|
+
className: "flex-1",
|
|
27185
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
27186
|
+
type: field.secret ? "password" : "text",
|
|
27187
|
+
value: credentialData[field.key] || "",
|
|
27188
|
+
onChange: function onChange(value) {
|
|
27189
|
+
return handleCredentialChange(field.key, value);
|
|
27190
|
+
},
|
|
27191
|
+
placeholder: field.type === "file" ? "Select a file..." : "Enter ".concat(field.displayName.toLowerCase())
|
|
27192
|
+
})
|
|
27193
|
+
}), field.type === "file" && /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
27194
|
+
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27195
|
+
var filepath;
|
|
27196
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
27197
|
+
while (1) switch (_context.prev = _context.next) {
|
|
27198
|
+
case 0:
|
|
27199
|
+
_context.next = 1;
|
|
27200
|
+
return window.mainApi.dialog.chooseFile(true, ["json"]);
|
|
27201
|
+
case 1:
|
|
27202
|
+
filepath = _context.sent;
|
|
27203
|
+
if (filepath) handleCredentialChange(field.key, filepath);
|
|
27204
|
+
case 2:
|
|
27205
|
+
case "end":
|
|
27206
|
+
return _context.stop();
|
|
27207
|
+
}
|
|
27208
|
+
}, _callee);
|
|
27209
|
+
})),
|
|
27210
|
+
className: "px-3 py-1.5 text-sm rounded bg-white/10 hover:bg-white/20 transition-colors",
|
|
27211
|
+
children: "Browse"
|
|
27212
|
+
})]
|
|
27084
27213
|
}), formErrors[field.key] && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
27085
27214
|
className: "text-sm text-red-400",
|
|
27086
27215
|
children: formErrors[field.key]
|
|
@@ -27515,13 +27644,38 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27515
27644
|
}), field.instructions && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
27516
27645
|
className: "text-sm opacity-50",
|
|
27517
27646
|
children: field.instructions
|
|
27518
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
27519
|
-
|
|
27520
|
-
|
|
27521
|
-
|
|
27522
|
-
|
|
27523
|
-
|
|
27524
|
-
|
|
27647
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27648
|
+
className: "flex gap-2",
|
|
27649
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27650
|
+
className: "flex-1",
|
|
27651
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
27652
|
+
type: field.secret ? "password" : "text",
|
|
27653
|
+
value: credentialData[field.key] || "",
|
|
27654
|
+
onChange: function onChange(value) {
|
|
27655
|
+
return handleCredentialChange(field.key, value);
|
|
27656
|
+
},
|
|
27657
|
+
placeholder: field.type === "file" ? "Select a file..." : "Enter ".concat(field.displayName.toLowerCase())
|
|
27658
|
+
})
|
|
27659
|
+
}), field.type === "file" && /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
27660
|
+
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27661
|
+
var filepath;
|
|
27662
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
27663
|
+
while (1) switch (_context.prev = _context.next) {
|
|
27664
|
+
case 0:
|
|
27665
|
+
_context.next = 1;
|
|
27666
|
+
return window.mainApi.dialog.chooseFile(true, ["json"]);
|
|
27667
|
+
case 1:
|
|
27668
|
+
filepath = _context.sent;
|
|
27669
|
+
if (filepath) handleCredentialChange(field.key, filepath);
|
|
27670
|
+
case 2:
|
|
27671
|
+
case "end":
|
|
27672
|
+
return _context.stop();
|
|
27673
|
+
}
|
|
27674
|
+
}, _callee);
|
|
27675
|
+
})),
|
|
27676
|
+
className: "px-3 py-1.5 text-sm rounded bg-white/10 hover:bg-white/20 transition-colors",
|
|
27677
|
+
children: "Browse"
|
|
27678
|
+
})]
|
|
27525
27679
|
}), formErrors[field.key] && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
27526
27680
|
className: "text-sm text-red-400",
|
|
27527
27681
|
children: formErrors[field.key]
|
|
@@ -27660,42 +27814,58 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27660
27814
|
var appContext = React.useContext(AppContext);
|
|
27661
27815
|
var providers = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || {};
|
|
27662
27816
|
var refreshProviders = appContext === null || appContext === void 0 ? void 0 : appContext.refreshProviders;
|
|
27663
|
-
|
|
27817
|
+
|
|
27818
|
+
// Load MCP catalog for authCommand lookups
|
|
27819
|
+
var _useState = React.useState([]),
|
|
27664
27820
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27665
|
-
|
|
27666
|
-
|
|
27667
|
-
|
|
27821
|
+
catalog = _useState2[0],
|
|
27822
|
+
setCatalog = _useState2[1];
|
|
27823
|
+
React.useEffect(function () {
|
|
27824
|
+
if (!dashApi) return;
|
|
27825
|
+
dashApi.mcpGetCatalog(function (event, result) {
|
|
27826
|
+
if (result !== null && result !== void 0 && result.catalog) setCatalog(result.catalog);
|
|
27827
|
+
}, function () {});
|
|
27828
|
+
}, [dashApi]);
|
|
27829
|
+
var _useState3 = React.useState("credentials"),
|
|
27668
27830
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
27669
|
-
|
|
27670
|
-
|
|
27671
|
-
var _useState5 = React.useState(
|
|
27831
|
+
providerTab = _useState4[0],
|
|
27832
|
+
setProviderTab = _useState4[1];
|
|
27833
|
+
var _useState5 = React.useState(null),
|
|
27672
27834
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
27673
|
-
|
|
27674
|
-
|
|
27675
|
-
var _useState7 = React.useState(
|
|
27835
|
+
selectedName = _useState6[0],
|
|
27836
|
+
setSelectedName = _useState6[1];
|
|
27837
|
+
var _useState7 = React.useState(false),
|
|
27676
27838
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
27677
|
-
|
|
27678
|
-
|
|
27679
|
-
var _useState9 = React.useState(
|
|
27839
|
+
isCreating = _useState8[0],
|
|
27840
|
+
setIsCreating = _useState8[1];
|
|
27841
|
+
var _useState9 = React.useState(false),
|
|
27680
27842
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
27681
|
-
|
|
27682
|
-
|
|
27683
|
-
var _useState1 = React.useState(
|
|
27843
|
+
isEditing = _useState0[0],
|
|
27844
|
+
setIsEditing = _useState0[1];
|
|
27845
|
+
var _useState1 = React.useState(""),
|
|
27684
27846
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
27685
|
-
|
|
27686
|
-
|
|
27687
|
-
var _useState11 = React.useState(
|
|
27847
|
+
formName = _useState10[0],
|
|
27848
|
+
setFormName = _useState10[1];
|
|
27849
|
+
var _useState11 = React.useState(""),
|
|
27688
27850
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
27689
|
-
|
|
27690
|
-
|
|
27691
|
-
var _useState13 = React.useState(
|
|
27851
|
+
formType = _useState12[0],
|
|
27852
|
+
setFormType = _useState12[1];
|
|
27853
|
+
var _useState13 = React.useState({}),
|
|
27692
27854
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
27693
|
-
|
|
27694
|
-
|
|
27695
|
-
var _useState15 = React.useState(
|
|
27855
|
+
formCredentials = _useState14[0],
|
|
27856
|
+
setFormCredentials = _useState14[1];
|
|
27857
|
+
var _useState15 = React.useState(null),
|
|
27696
27858
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
27697
|
-
|
|
27698
|
-
|
|
27859
|
+
deleteTarget = _useState16[0],
|
|
27860
|
+
setDeleteTarget = _useState16[1];
|
|
27861
|
+
var _useState17 = React.useState(false),
|
|
27862
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
27863
|
+
isAddingMcp = _useState18[0],
|
|
27864
|
+
setIsAddingMcp = _useState18[1];
|
|
27865
|
+
var _useState19 = React.useState(false),
|
|
27866
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
27867
|
+
isEditingMcp = _useState20[0],
|
|
27868
|
+
setIsEditingMcp = _useState20[1];
|
|
27699
27869
|
|
|
27700
27870
|
// Row ID counter for env/header rows in MCP edit mode
|
|
27701
27871
|
var nextRowIdRef = React.useRef(0);
|
|
@@ -27738,6 +27908,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27738
27908
|
credentials: credentials
|
|
27739
27909
|
}, function () {
|
|
27740
27910
|
resetForm();
|
|
27911
|
+
setProviderTab("credentials");
|
|
27741
27912
|
refreshProviders && refreshProviders();
|
|
27742
27913
|
}, function (e, err) {
|
|
27743
27914
|
return (void 0);
|
|
@@ -27746,6 +27917,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27746
27917
|
function handleStartEdit(name, provider) {
|
|
27747
27918
|
setSelectedName(name);
|
|
27748
27919
|
setIsCreating(false);
|
|
27920
|
+
setProviderTab(provider.providerClass === "mcp" ? "mcp" : "credentials");
|
|
27749
27921
|
if (provider.providerClass === "mcp") {
|
|
27750
27922
|
setIsEditingMcp(true);
|
|
27751
27923
|
setIsEditing(false);
|
|
@@ -27810,6 +27982,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27810
27982
|
setIsAddingMcp(false);
|
|
27811
27983
|
refreshProviders && refreshProviders();
|
|
27812
27984
|
setSelectedName(providerName);
|
|
27985
|
+
setProviderTab("mcp");
|
|
27813
27986
|
}, function (e, err) {
|
|
27814
27987
|
return (void 0);
|
|
27815
27988
|
});
|
|
@@ -27831,6 +28004,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27831
28004
|
mcpConfig: mcpConfig
|
|
27832
28005
|
}, function () {
|
|
27833
28006
|
setSelectedName(providerName);
|
|
28007
|
+
setProviderTab("mcp");
|
|
27834
28008
|
setIsEditingMcp(false);
|
|
27835
28009
|
resetForm();
|
|
27836
28010
|
refreshProviders && refreshProviders();
|
|
@@ -27855,19 +28029,39 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27855
28029
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27856
28030
|
}, [createRequested]);
|
|
27857
28031
|
var selectedProvider = selectedName && providers[selectedName] ? providers[selectedName] : null;
|
|
27858
|
-
var
|
|
27859
|
-
|
|
27860
|
-
|
|
27861
|
-
|
|
27862
|
-
|
|
27863
|
-
|
|
28032
|
+
var activeProviders = providerTab === "credentials" ? credentialProviders : mcpProviders;
|
|
28033
|
+
var activeIcon = providerTab === "credentials" ? "key" : "server";
|
|
28034
|
+
var listContent = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
28035
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28036
|
+
className: "px-2 pt-2",
|
|
28037
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3, {
|
|
28038
|
+
value: providerTab,
|
|
28039
|
+
onValueChange: setProviderTab,
|
|
28040
|
+
backgroundColor: "bg-transparent",
|
|
28041
|
+
spacing: "p-0",
|
|
28042
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Tabs3.List, {
|
|
28043
|
+
className: "w-full flex",
|
|
28044
|
+
spacing: "p-0.5",
|
|
28045
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
28046
|
+
value: "credentials",
|
|
28047
|
+
className: "flex-1",
|
|
28048
|
+
children: "API Credentials"
|
|
28049
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
28050
|
+
value: "mcp",
|
|
28051
|
+
className: "flex-1",
|
|
28052
|
+
children: "MCP Servers"
|
|
28053
|
+
})]
|
|
28054
|
+
})
|
|
28055
|
+
})
|
|
28056
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Content, {
|
|
28057
|
+
children: [activeProviders.map(function (_ref8) {
|
|
27864
28058
|
var _ref9 = _slicedToArray(_ref8, 2),
|
|
27865
28059
|
name = _ref9[0],
|
|
27866
28060
|
provider = _ref9[1];
|
|
27867
28061
|
var isSelected = selectedName === name && !isCreating;
|
|
27868
28062
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
|
|
27869
28063
|
icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27870
|
-
icon:
|
|
28064
|
+
icon: activeIcon,
|
|
27871
28065
|
className: "h-3.5 w-3.5"
|
|
27872
28066
|
}),
|
|
27873
28067
|
active: isSelected,
|
|
@@ -27884,54 +28078,25 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27884
28078
|
className: isSelected ? "bg-white/10 opacity-100" : "",
|
|
27885
28079
|
children: name
|
|
27886
28080
|
}, name);
|
|
27887
|
-
})
|
|
27888
|
-
|
|
27889
|
-
|
|
27890
|
-
|
|
27891
|
-
|
|
27892
|
-
|
|
27893
|
-
var _ref1 = _slicedToArray(_ref0, 2),
|
|
27894
|
-
name = _ref1[0],
|
|
27895
|
-
provider = _ref1[1];
|
|
27896
|
-
var isSelected = selectedName === name && !isCreating;
|
|
27897
|
-
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
|
|
27898
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27899
|
-
icon: "server",
|
|
27900
|
-
className: "h-3.5 w-3.5"
|
|
27901
|
-
}),
|
|
27902
|
-
active: isSelected,
|
|
28081
|
+
}), activeProviders.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28082
|
+
className: "text-sm opacity-40 py-8 text-center",
|
|
28083
|
+
children: providerTab === "credentials" ? "No API credentials configured" : "No MCP servers configured"
|
|
28084
|
+
}), providerTab === "mcp" && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28085
|
+
className: "px-3 py-3 mt-2 border-t border-white/10",
|
|
28086
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27903
28087
|
onClick: function onClick() {
|
|
27904
|
-
|
|
28088
|
+
setIsAddingMcp(true);
|
|
28089
|
+
setSelectedName(null);
|
|
27905
28090
|
setIsCreating(false);
|
|
27906
28091
|
setIsEditing(false);
|
|
27907
|
-
setIsAddingMcp(false);
|
|
27908
|
-
resetForm();
|
|
27909
28092
|
},
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
-
|
|
27915
|
-
}
|
|
28093
|
+
className: "flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300 transition-colors w-full",
|
|
28094
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
28095
|
+
icon: "plus",
|
|
28096
|
+
className: "h-3 w-3"
|
|
28097
|
+
}), "Add MCP Server"]
|
|
28098
|
+
})
|
|
27916
28099
|
})]
|
|
27917
|
-
}), providerEntries.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
27918
|
-
className: "text-sm opacity-40 py-8 text-center",
|
|
27919
|
-
children: "No providers configured"
|
|
27920
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27921
|
-
className: "px-3 py-3 mt-2 border-t border-white/10",
|
|
27922
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27923
|
-
onClick: function onClick() {
|
|
27924
|
-
setIsAddingMcp(true);
|
|
27925
|
-
setSelectedName(null);
|
|
27926
|
-
setIsCreating(false);
|
|
27927
|
-
setIsEditing(false);
|
|
27928
|
-
},
|
|
27929
|
-
className: "flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300 transition-colors w-full",
|
|
27930
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27931
|
-
icon: "plus",
|
|
27932
|
-
className: "h-3 w-3"
|
|
27933
|
-
}), "Add MCP Server"]
|
|
27934
|
-
})
|
|
27935
28100
|
})]
|
|
27936
28101
|
});
|
|
27937
28102
|
var detailContent = null;
|
|
@@ -27975,6 +28140,10 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27975
28140
|
}
|
|
27976
28141
|
});
|
|
27977
28142
|
} else if (selectedName && selectedProvider) {
|
|
28143
|
+
// Look up authCommand from the catalog for this provider type
|
|
28144
|
+
var catalogEntry = catalog.find(function (entry) {
|
|
28145
|
+
return entry.id === selectedProvider.type;
|
|
28146
|
+
});
|
|
27978
28147
|
detailContent = /*#__PURE__*/jsxRuntime.jsx(ProviderDetail, {
|
|
27979
28148
|
providerName: selectedName,
|
|
27980
28149
|
provider: selectedProvider,
|
|
@@ -27990,7 +28159,8 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27990
28159
|
onStartEdit: handleStartEdit,
|
|
27991
28160
|
onDelete: function onDelete(name) {
|
|
27992
28161
|
return setDeleteTarget(name);
|
|
27993
|
-
}
|
|
28162
|
+
},
|
|
28163
|
+
catalogAuthCommand: (catalogEntry === null || catalogEntry === void 0 ? void 0 : catalogEntry.authCommand) || null
|
|
27994
28164
|
});
|
|
27995
28165
|
}
|
|
27996
28166
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -33868,6 +34038,8 @@ exports.MCP_LIST_TOOLS_COMPLETE = MCP_LIST_TOOLS_COMPLETE;
|
|
|
33868
34038
|
exports.MCP_LIST_TOOLS_ERROR = MCP_LIST_TOOLS_ERROR;
|
|
33869
34039
|
exports.MCP_READ_RESOURCE_COMPLETE = MCP_READ_RESOURCE_COMPLETE;
|
|
33870
34040
|
exports.MCP_READ_RESOURCE_ERROR = MCP_READ_RESOURCE_ERROR;
|
|
34041
|
+
exports.MCP_RUN_AUTH_COMPLETE = MCP_RUN_AUTH_COMPLETE;
|
|
34042
|
+
exports.MCP_RUN_AUTH_ERROR = MCP_RUN_AUTH_ERROR;
|
|
33871
34043
|
exports.MCP_SERVER_STATUS_COMPLETE = MCP_SERVER_STATUS_COMPLETE;
|
|
33872
34044
|
exports.MCP_SERVER_STATUS_ERROR = MCP_SERVER_STATUS_ERROR;
|
|
33873
34045
|
exports.MCP_START_SERVER_COMPLETE = MCP_START_SERVER_COMPLETE;
|