@trops/dash-core 0.1.66 → 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 +203 -123
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +203 -123
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -25981,7 +25981,7 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
25981
25981
|
}
|
|
25982
25982
|
};
|
|
25983
25983
|
return /*#__PURE__*/jsxs("div", {
|
|
25984
|
-
className: "space-y-2",
|
|
25984
|
+
className: "space-y-2 flex-1 flex flex-col min-h-0",
|
|
25985
25985
|
children: [/*#__PURE__*/jsxs("div", {
|
|
25986
25986
|
className: "flex items-center justify-between",
|
|
25987
25987
|
children: [/*#__PURE__*/jsx("p", {
|
|
@@ -25996,7 +25996,7 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
25996
25996
|
className: "text-sm opacity-50",
|
|
25997
25997
|
children: "Choose which tools this provider can expose to widgets"
|
|
25998
25998
|
}), /*#__PURE__*/jsx("div", {
|
|
25999
|
-
className: "space-y-1
|
|
25999
|
+
className: "space-y-1 flex-1 min-h-0 overflow-y-auto",
|
|
26000
26000
|
children: tools.map(function (tool) {
|
|
26001
26001
|
var checked = selectedTools.includes(tool.name);
|
|
26002
26002
|
return /*#__PURE__*/jsxs("label", {
|
|
@@ -26747,7 +26747,9 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
26747
26747
|
_ref2$initialCredenti2 = _ref2.initialCredentials,
|
|
26748
26748
|
initialCredentials = _ref2$initialCredenti2 === void 0 ? {} : _ref2$initialCredenti2,
|
|
26749
26749
|
_ref2$initialAllowedT = _ref2.initialAllowedTools,
|
|
26750
|
-
initialAllowedTools = _ref2$initialAllowedT === void 0 ? null : _ref2$initialAllowedT
|
|
26750
|
+
initialAllowedTools = _ref2$initialAllowedT === void 0 ? null : _ref2$initialAllowedT,
|
|
26751
|
+
_ref2$initialAuthComm = _ref2.initialAuthCommand,
|
|
26752
|
+
initialAuthCommand = _ref2$initialAuthComm === void 0 ? null : _ref2$initialAuthComm;
|
|
26751
26753
|
var appContext = useContext(AppContext);
|
|
26752
26754
|
var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
|
|
26753
26755
|
|
|
@@ -26815,19 +26817,29 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
26815
26817
|
wizardStep = _useState24[0],
|
|
26816
26818
|
setWizardStep = _useState24[1];
|
|
26817
26819
|
|
|
26818
|
-
//
|
|
26819
|
-
var _useState25 = useState(
|
|
26820
|
+
// Auth state
|
|
26821
|
+
var _useState25 = useState(false),
|
|
26820
26822
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
26821
|
-
|
|
26822
|
-
|
|
26823
|
-
var _useState27 = useState(
|
|
26823
|
+
isAuthorizing = _useState26[0],
|
|
26824
|
+
setIsAuthorizing = _useState26[1];
|
|
26825
|
+
var _useState27 = useState(null),
|
|
26824
26826
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
26825
|
-
|
|
26826
|
-
|
|
26827
|
-
|
|
26827
|
+
authResult = _useState28[0],
|
|
26828
|
+
setAuthResult = _useState28[1];
|
|
26829
|
+
|
|
26830
|
+
// JSON editor state
|
|
26831
|
+
var _useState29 = useState("form"),
|
|
26828
26832
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
26829
|
-
|
|
26830
|
-
|
|
26833
|
+
viewMode = _useState30[0],
|
|
26834
|
+
setViewMode = _useState30[1]; // "form" | "json"
|
|
26835
|
+
var _useState31 = useState(""),
|
|
26836
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
26837
|
+
jsonText = _useState32[0],
|
|
26838
|
+
setJsonText = _useState32[1];
|
|
26839
|
+
var _useState33 = useState(null),
|
|
26840
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
26841
|
+
jsonError = _useState34[0],
|
|
26842
|
+
setJsonError = _useState34[1];
|
|
26831
26843
|
|
|
26832
26844
|
// Clear credential data when transport changes (derived fields change entirely)
|
|
26833
26845
|
// Only in create mode — in edit mode the initial transport is set correctly
|
|
@@ -26835,22 +26847,27 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
26835
26847
|
if (!isEditMode) {
|
|
26836
26848
|
setCredentialData({});
|
|
26837
26849
|
setTestResult(null);
|
|
26850
|
+
setAuthResult(null);
|
|
26838
26851
|
}
|
|
26839
26852
|
}, [transport, isEditMode]);
|
|
26840
26853
|
|
|
26854
|
+
// Dynamic wizard steps based on whether auth is needed
|
|
26855
|
+
var hasAuth = !!initialAuthCommand;
|
|
26856
|
+
var wizardSteps = hasAuth ? ["configure", "authorize", "testTools"] : ["configure", "testTools"];
|
|
26857
|
+
var totalSteps = wizardSteps.length;
|
|
26858
|
+
var currentStepType = wizardSteps[wizardStep];
|
|
26859
|
+
|
|
26841
26860
|
// Wizard step navigation with validation gates
|
|
26842
26861
|
var handleWizardStepChange = function handleWizardStepChange(newStep) {
|
|
26843
26862
|
if (newStep < wizardStep) {
|
|
26844
26863
|
setWizardStep(newStep);
|
|
26845
26864
|
return;
|
|
26846
26865
|
}
|
|
26847
|
-
|
|
26848
|
-
if (wizardStep === 0 && newStep >= 1) {
|
|
26866
|
+
if (currentStepType === "configure" && newStep > wizardStep) {
|
|
26849
26867
|
if (viewMode === "form" && !validateForm()) return;
|
|
26850
26868
|
}
|
|
26851
|
-
|
|
26852
|
-
|
|
26853
|
-
if (!(testResult !== null && testResult !== void 0 && testResult.success) && !(isEditMode && initialAllowedTools)) return;
|
|
26869
|
+
if (currentStepType === "authorize" && newStep > wizardStep) {
|
|
26870
|
+
if (!(authResult !== null && authResult !== void 0 && authResult.success)) return;
|
|
26854
26871
|
}
|
|
26855
26872
|
setWizardStep(newStep);
|
|
26856
26873
|
};
|
|
@@ -27046,6 +27063,33 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27046
27063
|
});
|
|
27047
27064
|
};
|
|
27048
27065
|
|
|
27066
|
+
// --- authorize (OAuth browser flow) ---
|
|
27067
|
+
var handleAuthorize = function handleAuthorize() {
|
|
27068
|
+
if (!dashApi || !initialAuthCommand) return;
|
|
27069
|
+
setIsAuthorizing(true);
|
|
27070
|
+
setAuthResult(null);
|
|
27071
|
+
dashApi.mcpRunAuth(mcpConfig, credentialData, initialAuthCommand, function (event, result) {
|
|
27072
|
+
if (result.error) {
|
|
27073
|
+
setAuthResult({
|
|
27074
|
+
success: false,
|
|
27075
|
+
message: result.message
|
|
27076
|
+
});
|
|
27077
|
+
} else {
|
|
27078
|
+
setAuthResult({
|
|
27079
|
+
success: true,
|
|
27080
|
+
message: "Authorized!"
|
|
27081
|
+
});
|
|
27082
|
+
}
|
|
27083
|
+
setIsAuthorizing(false);
|
|
27084
|
+
}, function (event, err) {
|
|
27085
|
+
setAuthResult({
|
|
27086
|
+
success: false,
|
|
27087
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || "Authorization failed"
|
|
27088
|
+
});
|
|
27089
|
+
setIsAuthorizing(false);
|
|
27090
|
+
});
|
|
27091
|
+
};
|
|
27092
|
+
|
|
27049
27093
|
// --- save ---
|
|
27050
27094
|
var handleSave = function handleSave() {
|
|
27051
27095
|
// If in JSON mode, parse JSON first to update form state
|
|
@@ -27099,12 +27143,12 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27099
27143
|
activeStep: wizardStep,
|
|
27100
27144
|
onStepChange: handleWizardStepChange,
|
|
27101
27145
|
showNavigation: false,
|
|
27102
|
-
className: "flex-1 min-h-0 flex flex-col",
|
|
27146
|
+
className: "flex-1 min-h-0 flex flex-col px-6 pt-4",
|
|
27103
27147
|
children: [/*#__PURE__*/jsx(Stepper.Step, {
|
|
27104
27148
|
label: "Configure",
|
|
27105
27149
|
description: "Server & credentials",
|
|
27106
27150
|
children: /*#__PURE__*/jsxs("div", {
|
|
27107
|
-
className: "flex-1 min-h-0 overflow-y-auto
|
|
27151
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
27108
27152
|
children: [/*#__PURE__*/jsxs("div", {
|
|
27109
27153
|
className: "flex flex-col gap-2",
|
|
27110
27154
|
children: [/*#__PURE__*/jsx(FormLabel, {
|
|
@@ -27467,46 +27511,76 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27467
27511
|
})]
|
|
27468
27512
|
})]
|
|
27469
27513
|
})
|
|
27470
|
-
}), /*#__PURE__*/jsx(Stepper.Step, {
|
|
27471
|
-
label: "
|
|
27472
|
-
description: "
|
|
27514
|
+
}), hasAuth && /*#__PURE__*/jsx(Stepper.Step, {
|
|
27515
|
+
label: "Authorize",
|
|
27516
|
+
description: "OAuth authentication",
|
|
27473
27517
|
children: /*#__PURE__*/jsxs("div", {
|
|
27474
|
-
className: "flex-1 min-h-0 overflow-y-auto
|
|
27518
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
27475
27519
|
children: [/*#__PURE__*/jsxs("div", {
|
|
27476
27520
|
className: "flex flex-col items-center justify-center py-8 space-y-4",
|
|
27477
27521
|
children: [/*#__PURE__*/jsx("p", {
|
|
27478
|
-
className: "text-sm opacity-60 text-center",
|
|
27479
|
-
children: "
|
|
27522
|
+
className: "text-sm opacity-60 text-center max-w-md",
|
|
27523
|
+
children: "This server requires OAuth authorization. Click the button below to open a browser window and complete the authentication flow."
|
|
27480
27524
|
}), /*#__PURE__*/jsx(Button, {
|
|
27481
|
-
title:
|
|
27482
|
-
onClick:
|
|
27525
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
27526
|
+
onClick: handleAuthorize,
|
|
27483
27527
|
size: "md"
|
|
27484
27528
|
})]
|
|
27485
|
-
}),
|
|
27486
|
-
className: "p-3 rounded-lg text-sm ".concat(
|
|
27529
|
+
}), authResult && /*#__PURE__*/jsx("div", {
|
|
27530
|
+
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"),
|
|
27487
27531
|
children: /*#__PURE__*/jsxs("div", {
|
|
27488
27532
|
className: "flex items-center gap-2",
|
|
27489
27533
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27490
|
-
icon:
|
|
27534
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
27491
27535
|
}), /*#__PURE__*/jsx("span", {
|
|
27492
|
-
children:
|
|
27536
|
+
children: authResult.message
|
|
27493
27537
|
})]
|
|
27494
27538
|
})
|
|
27539
|
+
}), authResult && !authResult.success && /*#__PURE__*/jsxs("div", {
|
|
27540
|
+
className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-2",
|
|
27541
|
+
children: [/*#__PURE__*/jsx("p", {
|
|
27542
|
+
className: "text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
27543
|
+
children: "Troubleshooting"
|
|
27544
|
+
}), /*#__PURE__*/jsxs("ul", {
|
|
27545
|
+
className: "text-sm opacity-60 space-y-1 list-disc list-inside",
|
|
27546
|
+
children: [/*#__PURE__*/jsx("li", {
|
|
27547
|
+
children: "Ensure Node.js and npx are available in your PATH"
|
|
27548
|
+
}), /*#__PURE__*/jsx("li", {
|
|
27549
|
+
children: "Try running the auth command manually in your terminal"
|
|
27550
|
+
}), /*#__PURE__*/jsx("li", {
|
|
27551
|
+
children: "Check that your OAuth credentials file is valid"
|
|
27552
|
+
}), /*#__PURE__*/jsx("li", {
|
|
27553
|
+
children: "If using nvm, ensure the correct Node version is active"
|
|
27554
|
+
})]
|
|
27555
|
+
})]
|
|
27495
27556
|
})]
|
|
27496
27557
|
})
|
|
27497
27558
|
}), /*#__PURE__*/jsx(Stepper.Step, {
|
|
27498
|
-
label: "Tools",
|
|
27499
|
-
description: "
|
|
27500
|
-
children: /*#__PURE__*/
|
|
27501
|
-
className: "flex-1 min-h-0
|
|
27502
|
-
children:
|
|
27559
|
+
label: "Test & Tools",
|
|
27560
|
+
description: "Verify & select tools",
|
|
27561
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
27562
|
+
className: "flex-1 min-h-0 flex flex-col pb-4 space-y-4",
|
|
27563
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
27564
|
+
className: "flex items-center gap-3",
|
|
27565
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
27566
|
+
title: isTesting ? "Fetching..." : "Fetch Tools",
|
|
27567
|
+
onClick: handleTestConnection,
|
|
27568
|
+
size: "sm"
|
|
27569
|
+
}), testResult && /*#__PURE__*/jsxs("span", {
|
|
27570
|
+
className: "text-sm ".concat(testResult.success ? "text-green-400" : "text-red-400"),
|
|
27571
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27572
|
+
icon: testResult.success ? "circle-check" : "circle-exclamation",
|
|
27573
|
+
className: "mr-1"
|
|
27574
|
+
}), testResult.message]
|
|
27575
|
+
})]
|
|
27576
|
+
}), (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__*/jsx(ToolSelector, {
|
|
27503
27577
|
tools: testResult.tools,
|
|
27504
27578
|
selectedTools: selectedTools,
|
|
27505
27579
|
onSelectionChange: setSelectedTools
|
|
27506
|
-
})
|
|
27580
|
+
}), !testResult && /*#__PURE__*/jsx("div", {
|
|
27507
27581
|
className: "text-center py-8 opacity-50",
|
|
27508
|
-
children: "
|
|
27509
|
-
})
|
|
27582
|
+
children: "Click \"Fetch Tools\" to test the connection and discover available tools."
|
|
27583
|
+
})]
|
|
27510
27584
|
})
|
|
27511
27585
|
})]
|
|
27512
27586
|
})
|
|
@@ -27529,30 +27603,24 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
|
|
|
27529
27603
|
className: "flex-1 text-center",
|
|
27530
27604
|
children: /*#__PURE__*/jsxs("span", {
|
|
27531
27605
|
className: "text-xs opacity-40",
|
|
27532
|
-
children: ["Step ", wizardStep + 1, " of
|
|
27606
|
+
children: ["Step ", wizardStep + 1, " of ", totalSteps]
|
|
27533
27607
|
})
|
|
27534
27608
|
}), /*#__PURE__*/jsxs("div", {
|
|
27535
27609
|
className: "flex flex-row gap-2",
|
|
27536
|
-
children: [
|
|
27610
|
+
children: [currentStepType === "configure" && /*#__PURE__*/jsx(Button, {
|
|
27537
27611
|
title: "Next",
|
|
27538
27612
|
onClick: function onClick() {
|
|
27539
|
-
return handleWizardStepChange(1);
|
|
27613
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
27540
27614
|
},
|
|
27541
27615
|
size: "sm"
|
|
27542
|
-
}),
|
|
27543
|
-
|
|
27544
|
-
|
|
27545
|
-
|
|
27546
|
-
|
|
27547
|
-
|
|
27548
|
-
|
|
27549
|
-
|
|
27550
|
-
return handleWizardStepChange(2);
|
|
27551
|
-
},
|
|
27552
|
-
disabled: !(testResult !== null && testResult !== void 0 && testResult.success) && !(isEditMode && initialAllowedTools),
|
|
27553
|
-
size: "sm"
|
|
27554
|
-
})]
|
|
27555
|
-
}), wizardStep === 2 && /*#__PURE__*/jsx(Button, {
|
|
27616
|
+
}), currentStepType === "authorize" && /*#__PURE__*/jsx(Button, {
|
|
27617
|
+
title: "Next",
|
|
27618
|
+
onClick: function onClick() {
|
|
27619
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
27620
|
+
},
|
|
27621
|
+
disabled: !(authResult !== null && authResult !== void 0 && authResult.success),
|
|
27622
|
+
size: "sm"
|
|
27623
|
+
}), currentStepType === "testTools" && /*#__PURE__*/jsx(Button, {
|
|
27556
27624
|
title: isEditMode ? "Save Changes" : "Save MCP Server",
|
|
27557
27625
|
onClick: handleSave,
|
|
27558
27626
|
size: "sm"
|
|
@@ -27711,20 +27779,23 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27711
27779
|
});
|
|
27712
27780
|
});
|
|
27713
27781
|
|
|
27782
|
+
// Dynamic wizard steps based on whether auth is needed
|
|
27783
|
+
var hasAuth = !!(selectedServer !== null && selectedServer !== void 0 && selectedServer.authCommand);
|
|
27784
|
+
var wizardSteps = hasAuth ? ["configure", "authorize", "testTools"] : ["configure", "testTools"];
|
|
27785
|
+
var totalSteps = wizardSteps.length;
|
|
27786
|
+
var currentStepType = wizardSteps[wizardStep];
|
|
27787
|
+
|
|
27714
27788
|
// Wizard step navigation with validation gates
|
|
27715
27789
|
var handleWizardStepChange = function handleWizardStepChange(newStep) {
|
|
27716
|
-
// Allow backward navigation freely
|
|
27717
27790
|
if (newStep < wizardStep) {
|
|
27718
27791
|
setWizardStep(newStep);
|
|
27719
27792
|
return;
|
|
27720
27793
|
}
|
|
27721
|
-
|
|
27722
|
-
if (wizardStep === 0 && newStep >= 1) {
|
|
27794
|
+
if (currentStepType === "configure" && newStep > wizardStep) {
|
|
27723
27795
|
if (!validateForm()) return;
|
|
27724
27796
|
}
|
|
27725
|
-
|
|
27726
|
-
|
|
27727
|
-
if (!(testResult !== null && testResult !== void 0 && testResult.success)) return;
|
|
27797
|
+
if (currentStepType === "authorize" && newStep > wizardStep) {
|
|
27798
|
+
if (!(authResult !== null && authResult !== void 0 && authResult.success)) return;
|
|
27728
27799
|
}
|
|
27729
27800
|
setWizardStep(newStep);
|
|
27730
27801
|
};
|
|
@@ -27927,12 +27998,12 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27927
27998
|
activeStep: wizardStep,
|
|
27928
27999
|
onStepChange: handleWizardStepChange,
|
|
27929
28000
|
showNavigation: false,
|
|
27930
|
-
className: "flex-1 min-h-0 flex flex-col",
|
|
28001
|
+
className: "flex-1 min-h-0 flex flex-col px-6 pt-4",
|
|
27931
28002
|
children: [/*#__PURE__*/jsx(Stepper.Step, {
|
|
27932
28003
|
label: "Configure",
|
|
27933
28004
|
description: "Name & credentials",
|
|
27934
28005
|
children: /*#__PURE__*/jsxs("div", {
|
|
27935
|
-
className: "flex-1 min-h-0 overflow-y-auto
|
|
28006
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
27936
28007
|
children: [/*#__PURE__*/jsxs("div", {
|
|
27937
28008
|
className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-3",
|
|
27938
28009
|
children: [/*#__PURE__*/jsx("p", {
|
|
@@ -28064,58 +28135,78 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
28064
28135
|
})]
|
|
28065
28136
|
}, field.key);
|
|
28066
28137
|
})]
|
|
28067
|
-
}), authResult && /*#__PURE__*/jsx("div", {
|
|
28068
|
-
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"),
|
|
28069
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
28070
|
-
className: "flex items-center gap-2",
|
|
28071
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
28072
|
-
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
28073
|
-
}), /*#__PURE__*/jsx("span", {
|
|
28074
|
-
children: authResult.message
|
|
28075
|
-
})]
|
|
28076
|
-
})
|
|
28077
28138
|
})]
|
|
28078
28139
|
})
|
|
28079
|
-
}), /*#__PURE__*/jsx(Stepper.Step, {
|
|
28080
|
-
label: "
|
|
28081
|
-
description: "
|
|
28140
|
+
}), hasAuth && /*#__PURE__*/jsx(Stepper.Step, {
|
|
28141
|
+
label: "Authorize",
|
|
28142
|
+
description: "OAuth authentication",
|
|
28082
28143
|
children: /*#__PURE__*/jsxs("div", {
|
|
28083
|
-
className: "flex-1 min-h-0 overflow-y-auto
|
|
28144
|
+
className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
|
|
28084
28145
|
children: [/*#__PURE__*/jsxs("div", {
|
|
28085
28146
|
className: "flex flex-col items-center justify-center py-8 space-y-4",
|
|
28086
28147
|
children: [/*#__PURE__*/jsx("p", {
|
|
28087
|
-
className: "text-sm opacity-60 text-center",
|
|
28088
|
-
children: "
|
|
28148
|
+
className: "text-sm opacity-60 text-center max-w-md",
|
|
28149
|
+
children: "This server requires OAuth authorization. Click the button below to open a browser window and complete the authentication flow."
|
|
28089
28150
|
}), /*#__PURE__*/jsx(Button, {
|
|
28090
|
-
title:
|
|
28091
|
-
onClick:
|
|
28151
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
28152
|
+
onClick: handleAuthorize,
|
|
28092
28153
|
size: "md"
|
|
28093
28154
|
})]
|
|
28094
|
-
}),
|
|
28095
|
-
className: "p-3 rounded-lg text-sm ".concat(
|
|
28155
|
+
}), authResult && /*#__PURE__*/jsx("div", {
|
|
28156
|
+
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"),
|
|
28096
28157
|
children: /*#__PURE__*/jsxs("div", {
|
|
28097
28158
|
className: "flex items-center gap-2",
|
|
28098
28159
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
28099
|
-
icon:
|
|
28160
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
28100
28161
|
}), /*#__PURE__*/jsx("span", {
|
|
28101
|
-
children:
|
|
28162
|
+
children: authResult.message
|
|
28102
28163
|
})]
|
|
28103
28164
|
})
|
|
28165
|
+
}), authResult && !authResult.success && /*#__PURE__*/jsxs("div", {
|
|
28166
|
+
className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-2",
|
|
28167
|
+
children: [/*#__PURE__*/jsx("p", {
|
|
28168
|
+
className: "text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
28169
|
+
children: "Troubleshooting"
|
|
28170
|
+
}), /*#__PURE__*/jsxs("ul", {
|
|
28171
|
+
className: "text-sm opacity-60 space-y-1 list-disc list-inside",
|
|
28172
|
+
children: [/*#__PURE__*/jsx("li", {
|
|
28173
|
+
children: "Ensure Node.js and npx are available in your PATH"
|
|
28174
|
+
}), /*#__PURE__*/jsx("li", {
|
|
28175
|
+
children: "Try running the auth command manually in your terminal"
|
|
28176
|
+
}), /*#__PURE__*/jsx("li", {
|
|
28177
|
+
children: "Check that your OAuth credentials file is valid"
|
|
28178
|
+
}), /*#__PURE__*/jsx("li", {
|
|
28179
|
+
children: "If using nvm, ensure the correct Node version is active"
|
|
28180
|
+
})]
|
|
28181
|
+
})]
|
|
28104
28182
|
})]
|
|
28105
28183
|
})
|
|
28106
28184
|
}), /*#__PURE__*/jsx(Stepper.Step, {
|
|
28107
|
-
label: "Tools",
|
|
28108
|
-
description: "
|
|
28109
|
-
children: /*#__PURE__*/
|
|
28110
|
-
className: "flex-1 min-h-0
|
|
28111
|
-
children:
|
|
28185
|
+
label: "Test & Tools",
|
|
28186
|
+
description: "Verify & select tools",
|
|
28187
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
28188
|
+
className: "flex-1 min-h-0 flex flex-col pb-4 space-y-4",
|
|
28189
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
28190
|
+
className: "flex items-center gap-3",
|
|
28191
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
28192
|
+
title: isTesting ? "Fetching..." : "Fetch Tools",
|
|
28193
|
+
onClick: handleTestConnection,
|
|
28194
|
+
size: "sm"
|
|
28195
|
+
}), testResult && /*#__PURE__*/jsxs("span", {
|
|
28196
|
+
className: "text-sm ".concat(testResult.success ? "text-green-400" : "text-red-400"),
|
|
28197
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
28198
|
+
icon: testResult.success ? "circle-check" : "circle-exclamation",
|
|
28199
|
+
className: "mr-1"
|
|
28200
|
+
}), testResult.message]
|
|
28201
|
+
})]
|
|
28202
|
+
}), (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__*/jsx(ToolSelector, {
|
|
28112
28203
|
tools: testResult.tools,
|
|
28113
28204
|
selectedTools: selectedTools,
|
|
28114
28205
|
onSelectionChange: setSelectedTools
|
|
28115
|
-
})
|
|
28206
|
+
}), !testResult && /*#__PURE__*/jsx("div", {
|
|
28116
28207
|
className: "text-center py-8 opacity-50",
|
|
28117
|
-
children: "
|
|
28118
|
-
})
|
|
28208
|
+
children: "Click \"Fetch Tools\" to test the connection and discover available tools."
|
|
28209
|
+
})]
|
|
28119
28210
|
})
|
|
28120
28211
|
})]
|
|
28121
28212
|
})
|
|
@@ -28138,36 +28229,24 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
28138
28229
|
className: "flex-1 text-center",
|
|
28139
28230
|
children: /*#__PURE__*/jsxs("span", {
|
|
28140
28231
|
className: "text-xs opacity-40",
|
|
28141
|
-
children: ["Step ", wizardStep + 1, " of
|
|
28232
|
+
children: ["Step ", wizardStep + 1, " of ", totalSteps]
|
|
28142
28233
|
})
|
|
28143
28234
|
}), /*#__PURE__*/jsxs("div", {
|
|
28144
28235
|
className: "flex flex-row gap-2",
|
|
28145
|
-
children: [
|
|
28146
|
-
|
|
28147
|
-
|
|
28148
|
-
|
|
28149
|
-
|
|
28150
|
-
|
|
28151
|
-
|
|
28152
|
-
|
|
28153
|
-
|
|
28154
|
-
|
|
28155
|
-
|
|
28156
|
-
|
|
28157
|
-
|
|
28158
|
-
|
|
28159
|
-
title: isTesting ? "Testing..." : "Test Connection",
|
|
28160
|
-
onClick: handleTestConnection,
|
|
28161
|
-
size: "sm"
|
|
28162
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
28163
|
-
title: "Next",
|
|
28164
|
-
onClick: function onClick() {
|
|
28165
|
-
return handleWizardStepChange(2);
|
|
28166
|
-
},
|
|
28167
|
-
disabled: !(testResult !== null && testResult !== void 0 && testResult.success),
|
|
28168
|
-
size: "sm"
|
|
28169
|
-
})]
|
|
28170
|
-
}), wizardStep === 2 && /*#__PURE__*/jsx(Button, {
|
|
28236
|
+
children: [currentStepType === "configure" && /*#__PURE__*/jsx(Button, {
|
|
28237
|
+
title: "Next",
|
|
28238
|
+
onClick: function onClick() {
|
|
28239
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
28240
|
+
},
|
|
28241
|
+
size: "sm"
|
|
28242
|
+
}), currentStepType === "authorize" && /*#__PURE__*/jsx(Button, {
|
|
28243
|
+
title: "Next",
|
|
28244
|
+
onClick: function onClick() {
|
|
28245
|
+
return handleWizardStepChange(wizardStep + 1);
|
|
28246
|
+
},
|
|
28247
|
+
disabled: !(authResult !== null && authResult !== void 0 && authResult.success),
|
|
28248
|
+
size: "sm"
|
|
28249
|
+
}), currentStepType === "testTools" && /*#__PURE__*/jsx(Button, {
|
|
28171
28250
|
title: "Save MCP Server",
|
|
28172
28251
|
onClick: handleSaveProvider,
|
|
28173
28252
|
size: "sm"
|
|
@@ -28613,11 +28692,12 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
28613
28692
|
initialHeaderRows: headerTemplateToRows(mc.headerTemplate, nextRowId),
|
|
28614
28693
|
initialCredentials: selectedProvider.credentials || {},
|
|
28615
28694
|
initialAllowedTools: selectedProvider.allowedTools || null,
|
|
28695
|
+
initialAuthCommand: (editCatalogEntry === null || editCatalogEntry === void 0 ? void 0 : editCatalogEntry.authCommand) || null,
|
|
28616
28696
|
onSave: handleMcpEditSave,
|
|
28617
28697
|
onBack: function onBack() {
|
|
28618
28698
|
return setIsEditingMcp(false);
|
|
28619
28699
|
}
|
|
28620
|
-
});
|
|
28700
|
+
}, selectedName);
|
|
28621
28701
|
} else if (selectedName && selectedProvider) {
|
|
28622
28702
|
// Look up authCommand from the catalog for this provider type
|
|
28623
28703
|
var catalogEntry = catalog.find(function (entry) {
|