@trops/dash-core 0.1.67 → 0.1.68
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 +197 -119
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +197 -119
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26000,7 +26000,7 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
26000
26000
|
}
|
|
26001
26001
|
};
|
|
26002
26002
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26003
|
-
className: "space-y-2",
|
|
26003
|
+
className: "space-y-2 flex-1 flex flex-col min-h-0",
|
|
26004
26004
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26005
26005
|
className: "flex items-center justify-between",
|
|
26006
26006
|
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
@@ -26015,7 +26015,7 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
26015
26015
|
className: "text-sm opacity-50",
|
|
26016
26016
|
children: "Choose which tools this provider can expose to widgets"
|
|
26017
26017
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26018
|
-
className: "space-y-1
|
|
26018
|
+
className: "space-y-1 flex-1 min-h-0 overflow-y-auto",
|
|
26019
26019
|
children: tools.map(function (tool) {
|
|
26020
26020
|
var checked = selectedTools.includes(tool.name);
|
|
26021
26021
|
return /*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
@@ -26766,7 +26766,9 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
26766
26766
|
_ref2$initialCredenti2 = _ref2.initialCredentials,
|
|
26767
26767
|
initialCredentials = _ref2$initialCredenti2 === void 0 ? {} : _ref2$initialCredenti2,
|
|
26768
26768
|
_ref2$initialAllowedT = _ref2.initialAllowedTools,
|
|
26769
|
-
initialAllowedTools = _ref2$initialAllowedT === void 0 ? null : _ref2$initialAllowedT
|
|
26769
|
+
initialAllowedTools = _ref2$initialAllowedT === void 0 ? null : _ref2$initialAllowedT,
|
|
26770
|
+
_ref2$initialAuthComm = _ref2.initialAuthCommand,
|
|
26771
|
+
initialAuthCommand = _ref2$initialAuthComm === void 0 ? null : _ref2$initialAuthComm;
|
|
26770
26772
|
var appContext = React.useContext(AppContext);
|
|
26771
26773
|
var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
|
|
26772
26774
|
|
|
@@ -26834,19 +26836,29 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
26834
26836
|
wizardStep = _useState24[0],
|
|
26835
26837
|
setWizardStep = _useState24[1];
|
|
26836
26838
|
|
|
26837
|
-
//
|
|
26838
|
-
var _useState25 = React.useState(
|
|
26839
|
+
// Auth state
|
|
26840
|
+
var _useState25 = React.useState(false),
|
|
26839
26841
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
26840
|
-
|
|
26841
|
-
|
|
26842
|
-
var _useState27 = React.useState(
|
|
26842
|
+
isAuthorizing = _useState26[0],
|
|
26843
|
+
setIsAuthorizing = _useState26[1];
|
|
26844
|
+
var _useState27 = React.useState(null),
|
|
26843
26845
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
26844
|
-
|
|
26845
|
-
|
|
26846
|
-
|
|
26846
|
+
authResult = _useState28[0],
|
|
26847
|
+
setAuthResult = _useState28[1];
|
|
26848
|
+
|
|
26849
|
+
// JSON editor state
|
|
26850
|
+
var _useState29 = React.useState("form"),
|
|
26847
26851
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
26848
|
-
|
|
26849
|
-
|
|
26852
|
+
viewMode = _useState30[0],
|
|
26853
|
+
setViewMode = _useState30[1]; // "form" | "json"
|
|
26854
|
+
var _useState31 = React.useState(""),
|
|
26855
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
26856
|
+
jsonText = _useState32[0],
|
|
26857
|
+
setJsonText = _useState32[1];
|
|
26858
|
+
var _useState33 = React.useState(null),
|
|
26859
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
26860
|
+
jsonError = _useState34[0],
|
|
26861
|
+
setJsonError = _useState34[1];
|
|
26850
26862
|
|
|
26851
26863
|
// Clear credential data when transport changes (derived fields change entirely)
|
|
26852
26864
|
// Only in create mode — in edit mode the initial transport is set correctly
|
|
@@ -26854,22 +26866,27 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
26854
26866
|
if (!isEditMode) {
|
|
26855
26867
|
setCredentialData({});
|
|
26856
26868
|
setTestResult(null);
|
|
26869
|
+
setAuthResult(null);
|
|
26857
26870
|
}
|
|
26858
26871
|
}, [transport, isEditMode]);
|
|
26859
26872
|
|
|
26873
|
+
// Dynamic wizard steps based on whether auth is needed
|
|
26874
|
+
var hasAuth = !!initialAuthCommand;
|
|
26875
|
+
var wizardSteps = hasAuth ? ["configure", "authorize", "testTools"] : ["configure", "testTools"];
|
|
26876
|
+
var totalSteps = wizardSteps.length;
|
|
26877
|
+
var currentStepType = wizardSteps[wizardStep];
|
|
26878
|
+
|
|
26860
26879
|
// Wizard step navigation with validation gates
|
|
26861
26880
|
var handleWizardStepChange = function handleWizardStepChange(newStep) {
|
|
26862
26881
|
if (newStep < wizardStep) {
|
|
26863
26882
|
setWizardStep(newStep);
|
|
26864
26883
|
return;
|
|
26865
26884
|
}
|
|
26866
|
-
|
|
26867
|
-
if (wizardStep === 0 && newStep >= 1) {
|
|
26885
|
+
if (currentStepType === "configure" && newStep > wizardStep) {
|
|
26868
26886
|
if (viewMode === "form" && !validateForm()) return;
|
|
26869
26887
|
}
|
|
26870
|
-
|
|
26871
|
-
|
|
26872
|
-
if (!(testResult !== null && testResult !== void 0 && testResult.success) && !(isEditMode && initialAllowedTools)) return;
|
|
26888
|
+
if (currentStepType === "authorize" && newStep > wizardStep) {
|
|
26889
|
+
if (!(authResult !== null && authResult !== void 0 && authResult.success)) return;
|
|
26873
26890
|
}
|
|
26874
26891
|
setWizardStep(newStep);
|
|
26875
26892
|
};
|
|
@@ -27065,6 +27082,33 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27065
27082
|
});
|
|
27066
27083
|
};
|
|
27067
27084
|
|
|
27085
|
+
// --- authorize (OAuth browser flow) ---
|
|
27086
|
+
var handleAuthorize = function handleAuthorize() {
|
|
27087
|
+
if (!dashApi || !initialAuthCommand) return;
|
|
27088
|
+
setIsAuthorizing(true);
|
|
27089
|
+
setAuthResult(null);
|
|
27090
|
+
dashApi.mcpRunAuth(mcpConfig, credentialData, initialAuthCommand, function (event, result) {
|
|
27091
|
+
if (result.error) {
|
|
27092
|
+
setAuthResult({
|
|
27093
|
+
success: false,
|
|
27094
|
+
message: result.message
|
|
27095
|
+
});
|
|
27096
|
+
} else {
|
|
27097
|
+
setAuthResult({
|
|
27098
|
+
success: true,
|
|
27099
|
+
message: "Authorized!"
|
|
27100
|
+
});
|
|
27101
|
+
}
|
|
27102
|
+
setIsAuthorizing(false);
|
|
27103
|
+
}, function (event, err) {
|
|
27104
|
+
setAuthResult({
|
|
27105
|
+
success: false,
|
|
27106
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || "Authorization failed"
|
|
27107
|
+
});
|
|
27108
|
+
setIsAuthorizing(false);
|
|
27109
|
+
});
|
|
27110
|
+
};
|
|
27111
|
+
|
|
27068
27112
|
// --- save ---
|
|
27069
27113
|
var handleSave = function handleSave() {
|
|
27070
27114
|
// If in JSON mode, parse JSON first to update form state
|
|
@@ -27486,46 +27530,76 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27486
27530
|
})]
|
|
27487
27531
|
})]
|
|
27488
27532
|
})
|
|
27489
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
27490
|
-
label: "
|
|
27491
|
-
description: "
|
|
27533
|
+
}), hasAuth && /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
27534
|
+
label: "Authorize",
|
|
27535
|
+
description: "OAuth authentication",
|
|
27492
27536
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27493
27537
|
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
27494
27538
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27495
27539
|
className: "flex flex-col items-center justify-center py-8 space-y-4",
|
|
27496
27540
|
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
27497
|
-
className: "text-sm opacity-60 text-center",
|
|
27498
|
-
children: "
|
|
27541
|
+
className: "text-sm opacity-60 text-center max-w-md",
|
|
27542
|
+
children: "This server requires OAuth authorization. Click the button below to open a browser window and complete the authentication flow."
|
|
27499
27543
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27500
|
-
title:
|
|
27501
|
-
onClick:
|
|
27544
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
27545
|
+
onClick: handleAuthorize,
|
|
27502
27546
|
size: "md"
|
|
27503
27547
|
})]
|
|
27504
|
-
}),
|
|
27505
|
-
className: "p-3 rounded-lg text-sm ".concat(
|
|
27548
|
+
}), authResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27549
|
+
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"),
|
|
27506
27550
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27507
27551
|
className: "flex items-center gap-2",
|
|
27508
27552
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27509
|
-
icon:
|
|
27553
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
27510
27554
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
27511
|
-
children:
|
|
27555
|
+
children: authResult.message
|
|
27512
27556
|
})]
|
|
27513
27557
|
})
|
|
27558
|
+
}), authResult && !authResult.success && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27559
|
+
className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-2",
|
|
27560
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
27561
|
+
className: "text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
27562
|
+
children: "Troubleshooting"
|
|
27563
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("ul", {
|
|
27564
|
+
className: "text-sm opacity-60 space-y-1 list-disc list-inside",
|
|
27565
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("li", {
|
|
27566
|
+
children: "Ensure Node.js and npx are available in your PATH"
|
|
27567
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
27568
|
+
children: "Try running the auth command manually in your terminal"
|
|
27569
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
27570
|
+
children: "Check that your OAuth credentials file is valid"
|
|
27571
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
27572
|
+
children: "If using nvm, ensure the correct Node version is active"
|
|
27573
|
+
})]
|
|
27574
|
+
})]
|
|
27514
27575
|
})]
|
|
27515
27576
|
})
|
|
27516
27577
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
27517
|
-
label: "Tools",
|
|
27518
|
-
description: "
|
|
27519
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
27520
|
-
className: "flex-1 min-h-0
|
|
27521
|
-
children:
|
|
27578
|
+
label: "Test & Tools",
|
|
27579
|
+
description: "Verify & select tools",
|
|
27580
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27581
|
+
className: "flex-1 min-h-0 flex flex-col pb-4 space-y-4",
|
|
27582
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27583
|
+
className: "flex items-center gap-3",
|
|
27584
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27585
|
+
title: isTesting ? "Fetching..." : "Fetch Tools",
|
|
27586
|
+
onClick: handleTestConnection,
|
|
27587
|
+
size: "sm"
|
|
27588
|
+
}), testResult && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
27589
|
+
className: "text-sm ".concat(testResult.success ? "text-green-400" : "text-red-400"),
|
|
27590
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27591
|
+
icon: testResult.success ? "circle-check" : "circle-exclamation",
|
|
27592
|
+
className: "mr-1"
|
|
27593
|
+
}), testResult.message]
|
|
27594
|
+
})]
|
|
27595
|
+
}), (testResult === null || testResult === void 0 ? void 0 : testResult.success) && ((_testResult$tools = testResult.tools) === null || _testResult$tools === void 0 ? void 0 : _testResult$tools.length) > 0 && selectedTools && /*#__PURE__*/jsxRuntime.jsx(ToolSelector, {
|
|
27522
27596
|
tools: testResult.tools,
|
|
27523
27597
|
selectedTools: selectedTools,
|
|
27524
27598
|
onSelectionChange: setSelectedTools
|
|
27525
|
-
})
|
|
27599
|
+
}), !testResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27526
27600
|
className: "text-center py-8 opacity-50",
|
|
27527
|
-
children: "
|
|
27528
|
-
})
|
|
27601
|
+
children: "Click \"Fetch Tools\" to test the connection and discover available tools."
|
|
27602
|
+
})]
|
|
27529
27603
|
})
|
|
27530
27604
|
})]
|
|
27531
27605
|
})
|
|
@@ -27548,30 +27622,24 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27548
27622
|
className: "flex-1 text-center",
|
|
27549
27623
|
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
27550
27624
|
className: "text-xs opacity-40",
|
|
27551
|
-
children: ["Step ", wizardStep + 1, " of
|
|
27625
|
+
children: ["Step ", wizardStep + 1, " of ", totalSteps]
|
|
27552
27626
|
})
|
|
27553
27627
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27554
27628
|
className: "flex flex-row gap-2",
|
|
27555
|
-
children: [
|
|
27629
|
+
children: [currentStepType === "configure" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27556
27630
|
title: "Next",
|
|
27557
27631
|
onClick: function onClick() {
|
|
27558
|
-
return handleWizardStepChange(1);
|
|
27632
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
27559
27633
|
},
|
|
27560
27634
|
size: "sm"
|
|
27561
|
-
}),
|
|
27562
|
-
|
|
27563
|
-
|
|
27564
|
-
|
|
27565
|
-
|
|
27566
|
-
|
|
27567
|
-
|
|
27568
|
-
|
|
27569
|
-
return handleWizardStepChange(2);
|
|
27570
|
-
},
|
|
27571
|
-
disabled: !(testResult !== null && testResult !== void 0 && testResult.success) && !(isEditMode && initialAllowedTools),
|
|
27572
|
-
size: "sm"
|
|
27573
|
-
})]
|
|
27574
|
-
}), wizardStep === 2 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27635
|
+
}), currentStepType === "authorize" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27636
|
+
title: "Next",
|
|
27637
|
+
onClick: function onClick() {
|
|
27638
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
27639
|
+
},
|
|
27640
|
+
disabled: !(authResult !== null && authResult !== void 0 && authResult.success),
|
|
27641
|
+
size: "sm"
|
|
27642
|
+
}), currentStepType === "testTools" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27575
27643
|
title: isEditMode ? "Save Changes" : "Save MCP Server",
|
|
27576
27644
|
onClick: handleSave,
|
|
27577
27645
|
size: "sm"
|
|
@@ -27730,21 +27798,23 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27730
27798
|
});
|
|
27731
27799
|
});
|
|
27732
27800
|
|
|
27801
|
+
// Dynamic wizard steps based on whether auth is needed
|
|
27802
|
+
var hasAuth = !!(selectedServer !== null && selectedServer !== void 0 && selectedServer.authCommand);
|
|
27803
|
+
var wizardSteps = hasAuth ? ["configure", "authorize", "testTools"] : ["configure", "testTools"];
|
|
27804
|
+
var totalSteps = wizardSteps.length;
|
|
27805
|
+
var currentStepType = wizardSteps[wizardStep];
|
|
27806
|
+
|
|
27733
27807
|
// Wizard step navigation with validation gates
|
|
27734
27808
|
var handleWizardStepChange = function handleWizardStepChange(newStep) {
|
|
27735
|
-
// Allow backward navigation freely
|
|
27736
27809
|
if (newStep < wizardStep) {
|
|
27737
27810
|
setWizardStep(newStep);
|
|
27738
27811
|
return;
|
|
27739
27812
|
}
|
|
27740
|
-
|
|
27741
|
-
if (wizardStep === 0 && newStep >= 1) {
|
|
27813
|
+
if (currentStepType === "configure" && newStep > wizardStep) {
|
|
27742
27814
|
if (!validateForm()) return;
|
|
27743
|
-
if (selectedServer !== null && selectedServer !== void 0 && selectedServer.authCommand && !(authResult !== null && authResult !== void 0 && authResult.success)) return;
|
|
27744
27815
|
}
|
|
27745
|
-
|
|
27746
|
-
|
|
27747
|
-
if (!(testResult !== null && testResult !== void 0 && testResult.success)) return;
|
|
27816
|
+
if (currentStepType === "authorize" && newStep > wizardStep) {
|
|
27817
|
+
if (!(authResult !== null && authResult !== void 0 && authResult.success)) return;
|
|
27748
27818
|
}
|
|
27749
27819
|
setWizardStep(newStep);
|
|
27750
27820
|
};
|
|
@@ -28084,58 +28154,78 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
28084
28154
|
})]
|
|
28085
28155
|
}, field.key);
|
|
28086
28156
|
})]
|
|
28087
|
-
}), authResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28088
|
-
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"),
|
|
28089
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28090
|
-
className: "flex items-center gap-2",
|
|
28091
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
28092
|
-
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
28093
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28094
|
-
children: authResult.message
|
|
28095
|
-
})]
|
|
28096
|
-
})
|
|
28097
28157
|
})]
|
|
28098
28158
|
})
|
|
28099
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
28100
|
-
label: "
|
|
28101
|
-
description: "
|
|
28159
|
+
}), hasAuth && /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
28160
|
+
label: "Authorize",
|
|
28161
|
+
description: "OAuth authentication",
|
|
28102
28162
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28103
28163
|
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
28104
28164
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28105
28165
|
className: "flex flex-col items-center justify-center py-8 space-y-4",
|
|
28106
28166
|
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28107
|
-
className: "text-sm opacity-60 text-center",
|
|
28108
|
-
children: "
|
|
28167
|
+
className: "text-sm opacity-60 text-center max-w-md",
|
|
28168
|
+
children: "This server requires OAuth authorization. Click the button below to open a browser window and complete the authentication flow."
|
|
28109
28169
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28110
|
-
title:
|
|
28111
|
-
onClick:
|
|
28170
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
28171
|
+
onClick: handleAuthorize,
|
|
28112
28172
|
size: "md"
|
|
28113
28173
|
})]
|
|
28114
|
-
}),
|
|
28115
|
-
className: "p-3 rounded-lg text-sm ".concat(
|
|
28174
|
+
}), authResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28175
|
+
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"),
|
|
28116
28176
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28117
28177
|
className: "flex items-center gap-2",
|
|
28118
28178
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
28119
|
-
icon:
|
|
28179
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
28120
28180
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28121
|
-
children:
|
|
28181
|
+
children: authResult.message
|
|
28122
28182
|
})]
|
|
28123
28183
|
})
|
|
28184
|
+
}), authResult && !authResult.success && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28185
|
+
className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-2",
|
|
28186
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("p", {
|
|
28187
|
+
className: "text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
28188
|
+
children: "Troubleshooting"
|
|
28189
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("ul", {
|
|
28190
|
+
className: "text-sm opacity-60 space-y-1 list-disc list-inside",
|
|
28191
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("li", {
|
|
28192
|
+
children: "Ensure Node.js and npx are available in your PATH"
|
|
28193
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
28194
|
+
children: "Try running the auth command manually in your terminal"
|
|
28195
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
28196
|
+
children: "Check that your OAuth credentials file is valid"
|
|
28197
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
28198
|
+
children: "If using nvm, ensure the correct Node version is active"
|
|
28199
|
+
})]
|
|
28200
|
+
})]
|
|
28124
28201
|
})]
|
|
28125
28202
|
})
|
|
28126
28203
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
28127
|
-
label: "Tools",
|
|
28128
|
-
description: "
|
|
28129
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
28130
|
-
className: "flex-1 min-h-0
|
|
28131
|
-
children:
|
|
28204
|
+
label: "Test & Tools",
|
|
28205
|
+
description: "Verify & select tools",
|
|
28206
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28207
|
+
className: "flex-1 min-h-0 flex flex-col pb-4 space-y-4",
|
|
28208
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28209
|
+
className: "flex items-center gap-3",
|
|
28210
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28211
|
+
title: isTesting ? "Fetching..." : "Fetch Tools",
|
|
28212
|
+
onClick: handleTestConnection,
|
|
28213
|
+
size: "sm"
|
|
28214
|
+
}), testResult && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
28215
|
+
className: "text-sm ".concat(testResult.success ? "text-green-400" : "text-red-400"),
|
|
28216
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
28217
|
+
icon: testResult.success ? "circle-check" : "circle-exclamation",
|
|
28218
|
+
className: "mr-1"
|
|
28219
|
+
}), testResult.message]
|
|
28220
|
+
})]
|
|
28221
|
+
}), (testResult === null || testResult === void 0 ? void 0 : testResult.success) && ((_testResult$tools = testResult.tools) === null || _testResult$tools === void 0 ? void 0 : _testResult$tools.length) > 0 && selectedTools && /*#__PURE__*/jsxRuntime.jsx(ToolSelector, {
|
|
28132
28222
|
tools: testResult.tools,
|
|
28133
28223
|
selectedTools: selectedTools,
|
|
28134
28224
|
onSelectionChange: setSelectedTools
|
|
28135
|
-
})
|
|
28225
|
+
}), !testResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28136
28226
|
className: "text-center py-8 opacity-50",
|
|
28137
|
-
children: "
|
|
28138
|
-
})
|
|
28227
|
+
children: "Click \"Fetch Tools\" to test the connection and discover available tools."
|
|
28228
|
+
})]
|
|
28139
28229
|
})
|
|
28140
28230
|
})]
|
|
28141
28231
|
})
|
|
@@ -28158,37 +28248,24 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
28158
28248
|
className: "flex-1 text-center",
|
|
28159
28249
|
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
28160
28250
|
className: "text-xs opacity-40",
|
|
28161
|
-
children: ["Step ", wizardStep + 1, " of
|
|
28251
|
+
children: ["Step ", wizardStep + 1, " of ", totalSteps]
|
|
28162
28252
|
})
|
|
28163
28253
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28164
28254
|
className: "flex flex-row gap-2",
|
|
28165
|
-
children: [
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28172
|
-
|
|
28173
|
-
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
}),
|
|
28179
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28180
|
-
title: isTesting ? "Testing..." : "Test Connection",
|
|
28181
|
-
onClick: handleTestConnection,
|
|
28182
|
-
size: "sm"
|
|
28183
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28184
|
-
title: "Next",
|
|
28185
|
-
onClick: function onClick() {
|
|
28186
|
-
return handleWizardStepChange(2);
|
|
28187
|
-
},
|
|
28188
|
-
disabled: !(testResult !== null && testResult !== void 0 && testResult.success),
|
|
28189
|
-
size: "sm"
|
|
28190
|
-
})]
|
|
28191
|
-
}), wizardStep === 2 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28255
|
+
children: [currentStepType === "configure" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28256
|
+
title: "Next",
|
|
28257
|
+
onClick: function onClick() {
|
|
28258
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
28259
|
+
},
|
|
28260
|
+
size: "sm"
|
|
28261
|
+
}), currentStepType === "authorize" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28262
|
+
title: "Next",
|
|
28263
|
+
onClick: function onClick() {
|
|
28264
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
28265
|
+
},
|
|
28266
|
+
disabled: !(authResult !== null && authResult !== void 0 && authResult.success),
|
|
28267
|
+
size: "sm"
|
|
28268
|
+
}), currentStepType === "testTools" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
28192
28269
|
title: "Save MCP Server",
|
|
28193
28270
|
onClick: handleSaveProvider,
|
|
28194
28271
|
size: "sm"
|
|
@@ -28634,11 +28711,12 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
28634
28711
|
initialHeaderRows: headerTemplateToRows(mc.headerTemplate, nextRowId),
|
|
28635
28712
|
initialCredentials: selectedProvider.credentials || {},
|
|
28636
28713
|
initialAllowedTools: selectedProvider.allowedTools || null,
|
|
28714
|
+
initialAuthCommand: (editCatalogEntry === null || editCatalogEntry === void 0 ? void 0 : editCatalogEntry.authCommand) || null,
|
|
28637
28715
|
onSave: handleMcpEditSave,
|
|
28638
28716
|
onBack: function onBack() {
|
|
28639
28717
|
return setIsEditingMcp(false);
|
|
28640
28718
|
}
|
|
28641
|
-
});
|
|
28719
|
+
}, selectedName);
|
|
28642
28720
|
} else if (selectedName && selectedProvider) {
|
|
28643
28721
|
// Look up authCommand from the catalog for this provider type
|
|
28644
28722
|
var catalogEntry = catalog.find(function (entry) {
|