@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.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 max-h-64 overflow-y-auto",
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
- // JSON editor state
26838
- var _useState25 = React.useState("form"),
26839
+ // Auth state
26840
+ var _useState25 = React.useState(false),
26839
26841
  _useState26 = _slicedToArray(_useState25, 2),
26840
- viewMode = _useState26[0],
26841
- setViewMode = _useState26[1]; // "form" | "json"
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
- jsonText = _useState28[0],
26845
- setJsonText = _useState28[1];
26846
- var _useState29 = React.useState(null),
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
- jsonError = _useState30[0],
26849
- setJsonError = _useState30[1];
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
- // Step 0→1: validate form (skip validation in JSON mode, handled on save)
26867
- if (wizardStep === 0 && newStep >= 1) {
26885
+ if (currentStepType === "configure" && newStep > wizardStep) {
26868
26886
  if (viewMode === "form" && !validateForm()) return;
26869
26887
  }
26870
- // Step 1→2: require test success OR edit mode with existing tools
26871
- if (wizardStep === 1 && newStep >= 2) {
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
@@ -27118,12 +27162,12 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
27118
27162
  activeStep: wizardStep,
27119
27163
  onStepChange: handleWizardStepChange,
27120
27164
  showNavigation: false,
27121
- className: "flex-1 min-h-0 flex flex-col",
27165
+ className: "flex-1 min-h-0 flex flex-col px-6 pt-4",
27122
27166
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
27123
27167
  label: "Configure",
27124
27168
  description: "Server & credentials",
27125
27169
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
27126
- className: "flex-1 min-h-0 overflow-y-auto px-6 pb-4 space-y-5",
27170
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
27127
27171
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
27128
27172
  className: "flex flex-col gap-2",
27129
27173
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FormLabel, {
@@ -27486,46 +27530,76 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
27486
27530
  })]
27487
27531
  })]
27488
27532
  })
27489
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
27490
- label: "Test",
27491
- description: "Verify connection",
27533
+ }), hasAuth && /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
27534
+ label: "Authorize",
27535
+ description: "OAuth authentication",
27492
27536
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
27493
- className: "flex-1 min-h-0 overflow-y-auto px-6 pb-4 space-y-5",
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: "Test the connection to verify your configuration is correct."
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: isTesting ? "Testing..." : "Test Connection",
27501
- onClick: handleTestConnection,
27544
+ title: isAuthorizing ? "Authorizing..." : "Authorize",
27545
+ onClick: handleAuthorize,
27502
27546
  size: "md"
27503
27547
  })]
27504
- }), testResult && /*#__PURE__*/jsxRuntime.jsx("div", {
27505
- 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"),
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: testResult.success ? "circle-check" : "circle-exclamation"
27553
+ icon: authResult.success ? "circle-check" : "circle-exclamation"
27510
27554
  }), /*#__PURE__*/jsxRuntime.jsx("span", {
27511
- children: testResult.message
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: "Select allowed tools",
27519
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
27520
- className: "flex-1 min-h-0 overflow-y-auto px-6 pb-4 space-y-5",
27521
- children: testResult !== null && testResult !== void 0 && testResult.success && ((_testResult$tools = testResult.tools) === null || _testResult$tools === void 0 ? void 0 : _testResult$tools.length) > 0 && selectedTools ? /*#__PURE__*/jsxRuntime.jsx(ToolSelector, {
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
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
27599
+ }), !testResult && /*#__PURE__*/jsxRuntime.jsx("div", {
27526
27600
  className: "text-center py-8 opacity-50",
27527
- children: "No tools available. Go back and test the connection first."
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 3"]
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: [wizardStep === 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
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
- }), wizardStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
27562
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
27563
- title: isTesting ? "Testing..." : "Test Connection",
27564
- onClick: handleTestConnection,
27565
- size: "sm"
27566
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
27567
- title: "Next",
27568
- onClick: function onClick() {
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,20 +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
- // Step 0→1: validate the configure form
27741
- if (wizardStep === 0 && newStep >= 1) {
27813
+ if (currentStepType === "configure" && newStep > wizardStep) {
27742
27814
  if (!validateForm()) return;
27743
27815
  }
27744
- // Step 1→2: require successful test
27745
- if (wizardStep === 1 && newStep >= 2) {
27746
- 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;
27747
27818
  }
27748
27819
  setWizardStep(newStep);
27749
27820
  };
@@ -27946,12 +28017,12 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
27946
28017
  activeStep: wizardStep,
27947
28018
  onStepChange: handleWizardStepChange,
27948
28019
  showNavigation: false,
27949
- className: "flex-1 min-h-0 flex flex-col",
28020
+ className: "flex-1 min-h-0 flex flex-col px-6 pt-4",
27950
28021
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
27951
28022
  label: "Configure",
27952
28023
  description: "Name & credentials",
27953
28024
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
27954
- className: "flex-1 min-h-0 overflow-y-auto px-6 pb-4 space-y-5",
28025
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
27955
28026
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
27956
28027
  className: "bg-white/5 border border-white/10 rounded-lg p-4 space-y-3",
27957
28028
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
@@ -28083,58 +28154,78 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
28083
28154
  })]
28084
28155
  }, field.key);
28085
28156
  })]
28086
- }), authResult && /*#__PURE__*/jsxRuntime.jsx("div", {
28087
- 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"),
28088
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
28089
- className: "flex items-center gap-2",
28090
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
28091
- icon: authResult.success ? "circle-check" : "circle-exclamation"
28092
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
28093
- children: authResult.message
28094
- })]
28095
- })
28096
28157
  })]
28097
28158
  })
28098
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
28099
- label: "Test",
28100
- description: "Verify connection",
28159
+ }), hasAuth && /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
28160
+ label: "Authorize",
28161
+ description: "OAuth authentication",
28101
28162
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
28102
- className: "flex-1 min-h-0 overflow-y-auto px-6 pb-4 space-y-5",
28163
+ className: "flex-1 min-h-0 overflow-y-auto pb-4 space-y-5",
28103
28164
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
28104
28165
  className: "flex flex-col items-center justify-center py-8 space-y-4",
28105
28166
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
28106
- className: "text-sm opacity-60 text-center",
28107
- children: "Test the connection to verify your configuration is correct."
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."
28108
28169
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
28109
- title: isTesting ? "Testing..." : "Test Connection",
28110
- onClick: handleTestConnection,
28170
+ title: isAuthorizing ? "Authorizing..." : "Authorize",
28171
+ onClick: handleAuthorize,
28111
28172
  size: "md"
28112
28173
  })]
28113
- }), testResult && /*#__PURE__*/jsxRuntime.jsx("div", {
28114
- 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"),
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"),
28115
28176
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
28116
28177
  className: "flex items-center gap-2",
28117
28178
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
28118
- icon: testResult.success ? "circle-check" : "circle-exclamation"
28179
+ icon: authResult.success ? "circle-check" : "circle-exclamation"
28119
28180
  }), /*#__PURE__*/jsxRuntime.jsx("span", {
28120
- children: testResult.message
28181
+ children: authResult.message
28121
28182
  })]
28122
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
+ })]
28123
28201
  })]
28124
28202
  })
28125
28203
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
28126
- label: "Tools",
28127
- description: "Select allowed tools",
28128
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
28129
- className: "flex-1 min-h-0 overflow-y-auto px-6 pb-4 space-y-5",
28130
- children: testResult !== null && testResult !== void 0 && testResult.success && ((_testResult$tools = testResult.tools) === null || _testResult$tools === void 0 ? void 0 : _testResult$tools.length) > 0 && selectedTools ? /*#__PURE__*/jsxRuntime.jsx(ToolSelector, {
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, {
28131
28222
  tools: testResult.tools,
28132
28223
  selectedTools: selectedTools,
28133
28224
  onSelectionChange: setSelectedTools
28134
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
28225
+ }), !testResult && /*#__PURE__*/jsxRuntime.jsx("div", {
28135
28226
  className: "text-center py-8 opacity-50",
28136
- children: "No tools available. Go back and test the connection first."
28137
- })
28227
+ children: "Click \"Fetch Tools\" to test the connection and discover available tools."
28228
+ })]
28138
28229
  })
28139
28230
  })]
28140
28231
  })
@@ -28157,36 +28248,24 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
28157
28248
  className: "flex-1 text-center",
28158
28249
  children: /*#__PURE__*/jsxRuntime.jsxs("span", {
28159
28250
  className: "text-xs opacity-40",
28160
- children: ["Step ", wizardStep + 1, " of 3"]
28251
+ children: ["Step ", wizardStep + 1, " of ", totalSteps]
28161
28252
  })
28162
28253
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
28163
28254
  className: "flex flex-row gap-2",
28164
- children: [wizardStep === 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
28165
- children: [(selectedServer === null || selectedServer === void 0 ? void 0 : selectedServer.authCommand) && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
28166
- title: isAuthorizing ? "Authorizing..." : "Authorize",
28167
- onClick: handleAuthorize,
28168
- size: "sm"
28169
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
28170
- title: "Next",
28171
- onClick: function onClick() {
28172
- return handleWizardStepChange(1);
28173
- },
28174
- size: "sm"
28175
- })]
28176
- }), wizardStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
28177
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
28178
- title: isTesting ? "Testing..." : "Test Connection",
28179
- onClick: handleTestConnection,
28180
- size: "sm"
28181
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
28182
- title: "Next",
28183
- onClick: function onClick() {
28184
- return handleWizardStepChange(2);
28185
- },
28186
- disabled: !(testResult !== null && testResult !== void 0 && testResult.success),
28187
- size: "sm"
28188
- })]
28189
- }), 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, {
28190
28269
  title: "Save MCP Server",
28191
28270
  onClick: handleSaveProvider,
28192
28271
  size: "sm"
@@ -28632,11 +28711,12 @@ var ProvidersSection = function ProvidersSection(_ref) {
28632
28711
  initialHeaderRows: headerTemplateToRows(mc.headerTemplate, nextRowId),
28633
28712
  initialCredentials: selectedProvider.credentials || {},
28634
28713
  initialAllowedTools: selectedProvider.allowedTools || null,
28714
+ initialAuthCommand: (editCatalogEntry === null || editCatalogEntry === void 0 ? void 0 : editCatalogEntry.authCommand) || null,
28635
28715
  onSave: handleMcpEditSave,
28636
28716
  onBack: function onBack() {
28637
28717
  return setIsEditingMcp(false);
28638
28718
  }
28639
- });
28719
+ }, selectedName);
28640
28720
  } else if (selectedName && selectedProvider) {
28641
28721
  // Look up authCommand from the catalog for this provider type
28642
28722
  var catalogEntry = catalog.find(function (entry) {