@trops/dash-core 0.1.637 → 0.1.639

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
@@ -47439,6 +47439,12 @@ function prettyServer(name) {
47439
47439
  return w.charAt(0).toUpperCase() + w.slice(1);
47440
47440
  }).join(" ");
47441
47441
  }
47442
+
47443
+ // "search_emails" / "list-calendars" → "Search emails" / "List calendars".
47444
+ function prettyTool(name) {
47445
+ var words = String(name || "").split(/[-_\s]+/).filter(Boolean).join(" ");
47446
+ return words.charAt(0).toUpperCase() + words.slice(1);
47447
+ }
47442
47448
  function getMainApi() {
47443
47449
  return typeof window !== "undefined" ? window.mainApi : null;
47444
47450
  }
@@ -47478,77 +47484,143 @@ var BotDetail = function BotDetail(_ref) {
47478
47484
  approvalPolicy = _useState10[0],
47479
47485
  setApprovalPolicy = _useState10[1];
47480
47486
 
47481
- // --- Tools & integrations (MCP servers) ---
47487
+ // --- Providers: the user's Dash MCP providers (Settings → Providers) ---
47482
47488
  var _useState11 = React.useState((bot === null || bot === void 0 ? void 0 : bot.mcpServers) || []),
47483
47489
  _useState12 = _slicedToArray(_useState11, 2),
47484
47490
  selectedServers = _useState12[0],
47485
47491
  setSelectedServers = _useState12[1];
47486
- var _useState13 = React.useState([]),
47492
+ // Per-provider narrowing within the provider's declared tools:
47493
+ // { [providerName]: string[] }. No entry → every tool the provider allows.
47494
+ var _useState13 = React.useState((bot === null || bot === void 0 ? void 0 : bot.toolSelections) || {}),
47487
47495
  _useState14 = _slicedToArray(_useState13, 2),
47488
- connectedServers = _useState14[0],
47489
- setConnectedServers = _useState14[1];
47490
-
47491
- // --- Model options (fetched per provider) ---
47496
+ toolSelections = _useState14[0],
47497
+ setToolSelections = _useState14[1];
47492
47498
  var _useState15 = React.useState([]),
47493
47499
  _useState16 = _slicedToArray(_useState15, 2),
47494
- modelOptions = _useState16[0],
47495
- setModelOptions = _useState16[1];
47500
+ toolSources = _useState16[0],
47501
+ setToolSources = _useState16[1];
47502
+ var _useState17 = React.useState(false),
47503
+ _useState18 = _slicedToArray(_useState17, 2),
47504
+ sourcesLoaded = _useState18[0],
47505
+ setSourcesLoaded = _useState18[1];
47506
+ // Remembered approvals ("Always allow") for a saved bot:
47507
+ // { [provider]: { tools: string[], folders: string[] } }.
47508
+ var _useState19 = React.useState({}),
47509
+ _useState20 = _slicedToArray(_useState19, 2),
47510
+ grants = _useState20[0],
47511
+ setGrants = _useState20[1];
47512
+ React.useEffect(function () {
47513
+ var _api$bots;
47514
+ var alive = true;
47515
+ var api = getMainApi();
47516
+ if (!(bot !== null && bot !== void 0 && bot.id) || !(api !== null && api !== void 0 && (_api$bots = api.bots) !== null && _api$bots !== void 0 && _api$bots.getGrants)) return undefined;
47517
+ Promise.resolve(api.bots.getGrants(bot.id)).then(function (g) {
47518
+ if (alive && g && _typeof(g) === "object") setGrants(g);
47519
+ })["catch"](function () {});
47520
+ return function () {
47521
+ alive = false;
47522
+ };
47523
+ }, [bot === null || bot === void 0 ? void 0 : bot.id]);
47524
+ var isRemembered = function isRemembered(serverName, tool) {
47525
+ return !!(grants[serverName] && (grants[serverName].tools || []).includes(tool));
47526
+ };
47527
+ var revokeRemembered = /*#__PURE__*/function () {
47528
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(serverName, tool) {
47529
+ var _api$bots2;
47530
+ var api, next;
47531
+ return _regeneratorRuntime.wrap(function (_context) {
47532
+ while (1) switch (_context.prev = _context.next) {
47533
+ case 0:
47534
+ api = getMainApi();
47535
+ if (!(!(bot !== null && bot !== void 0 && bot.id) || !(api !== null && api !== void 0 && (_api$bots2 = api.bots) !== null && _api$bots2 !== void 0 && _api$bots2.revokeGrant))) {
47536
+ _context.next = 1;
47537
+ break;
47538
+ }
47539
+ return _context.abrupt("return");
47540
+ case 1:
47541
+ _context.prev = 1;
47542
+ _context.next = 2;
47543
+ return api.bots.revokeGrant(bot.id, serverName, tool);
47544
+ case 2:
47545
+ next = _context.sent;
47546
+ setGrants(next && _typeof(next) === "object" ? next : {});
47547
+ _context.next = 4;
47548
+ break;
47549
+ case 3:
47550
+ _context.prev = 3;
47551
+ _context["catch"](1);
47552
+ case 4:
47553
+ case "end":
47554
+ return _context.stop();
47555
+ }
47556
+ }, _callee, null, [[1, 3]]);
47557
+ }));
47558
+ return function revokeRemembered(_x, _x2) {
47559
+ return _ref2.apply(this, arguments);
47560
+ };
47561
+ }();
47562
+
47563
+ // --- Model options (fetched per provider) ---
47564
+ var _useState21 = React.useState([]),
47565
+ _useState22 = _slicedToArray(_useState21, 2),
47566
+ modelOptions = _useState22[0],
47567
+ setModelOptions = _useState22[1];
47496
47568
 
47497
47569
  // --- Schedule (friendly dropdowns; raw cron behind Advanced) ---
47498
47570
  var initialCron = (bot === null || bot === void 0 || (_bot$schedules = bot.schedules) === null || _bot$schedules === void 0 || (_bot$schedules = _bot$schedules[0]) === null || _bot$schedules === void 0 ? void 0 : _bot$schedules.cron) || "";
47499
47571
  var parsed = parseCron(initialCron);
47500
- var _useState17 = React.useState(parsed.frequency === "custom" ? "off" : parsed.frequency),
47501
- _useState18 = _slicedToArray(_useState17, 2),
47502
- frequency = _useState18[0],
47503
- setFrequency = _useState18[1];
47504
- var _useState19 = React.useState(parsed.time || DEFAULT_SCHEDULE.time),
47505
- _useState20 = _slicedToArray(_useState19, 2),
47506
- time = _useState20[0],
47507
- setTime = _useState20[1];
47508
- var _useState21 = React.useState(parsed.dayOfWeek || DEFAULT_SCHEDULE.dayOfWeek),
47509
- _useState22 = _slicedToArray(_useState21, 2),
47510
- dayOfWeek = _useState22[0],
47511
- setDayOfWeek = _useState22[1];
47512
- var _useState23 = React.useState(parsed.dayOfMonth || DEFAULT_SCHEDULE.dayOfMonth),
47572
+ var _useState23 = React.useState(parsed.frequency === "custom" ? "off" : parsed.frequency),
47513
47573
  _useState24 = _slicedToArray(_useState23, 2),
47514
- dayOfMonth = _useState24[0],
47515
- setDayOfMonth = _useState24[1];
47516
- var _useState25 = React.useState(parsed.frequency === "custom"),
47574
+ frequency = _useState24[0],
47575
+ setFrequency = _useState24[1];
47576
+ var _useState25 = React.useState(parsed.time || DEFAULT_SCHEDULE.time),
47517
47577
  _useState26 = _slicedToArray(_useState25, 2),
47518
- advanced = _useState26[0],
47519
- setAdvanced = _useState26[1];
47520
- var _useState27 = React.useState(initialCron),
47578
+ time = _useState26[0],
47579
+ setTime = _useState26[1];
47580
+ var _useState27 = React.useState(parsed.dayOfWeek || DEFAULT_SCHEDULE.dayOfWeek),
47521
47581
  _useState28 = _slicedToArray(_useState27, 2),
47522
- advancedCron = _useState28[0],
47523
- setAdvancedCron = _useState28[1];
47524
- var _useState29 = React.useState((bot === null || bot === void 0 || (_bot$schedules2 = bot.schedules) === null || _bot$schedules2 === void 0 || (_bot$schedules2 = _bot$schedules2[0]) === null || _bot$schedules2 === void 0 ? void 0 : _bot$schedules2.prompt) || ""),
47582
+ dayOfWeek = _useState28[0],
47583
+ setDayOfWeek = _useState28[1];
47584
+ var _useState29 = React.useState(parsed.dayOfMonth || DEFAULT_SCHEDULE.dayOfMonth),
47525
47585
  _useState30 = _slicedToArray(_useState29, 2),
47526
- schedulePrompt = _useState30[0],
47527
- setSchedulePrompt = _useState30[1];
47586
+ dayOfMonth = _useState30[0],
47587
+ setDayOfMonth = _useState30[1];
47588
+ var _useState31 = React.useState(parsed.frequency === "custom"),
47589
+ _useState32 = _slicedToArray(_useState31, 2),
47590
+ advanced = _useState32[0],
47591
+ setAdvanced = _useState32[1];
47592
+ var _useState33 = React.useState(initialCron),
47593
+ _useState34 = _slicedToArray(_useState33, 2),
47594
+ advancedCron = _useState34[0],
47595
+ setAdvancedCron = _useState34[1];
47596
+ var _useState35 = React.useState((bot === null || bot === void 0 || (_bot$schedules2 = bot.schedules) === null || _bot$schedules2 === void 0 || (_bot$schedules2 = _bot$schedules2[0]) === null || _bot$schedules2 === void 0 ? void 0 : _bot$schedules2.prompt) || ""),
47597
+ _useState36 = _slicedToArray(_useState35, 2),
47598
+ schedulePrompt = _useState36[0],
47599
+ setSchedulePrompt = _useState36[1];
47528
47600
 
47529
47601
  // --- Run-on-events (subscriptions) ---
47530
- var _useState31 = React.useState(((bot === null || bot === void 0 ? void 0 : bot.subscriptions) || []).map(function (s) {
47602
+ var _useState37 = React.useState(((bot === null || bot === void 0 ? void 0 : bot.subscriptions) || []).map(function (s) {
47531
47603
  return s && s.eventType;
47532
47604
  }).filter(Boolean)),
47533
- _useState32 = _slicedToArray(_useState31, 2),
47534
- subscriptions = _useState32[0],
47535
- setSubscriptions = _useState32[1];
47536
- var _useState33 = React.useState(""),
47537
- _useState34 = _slicedToArray(_useState33, 2),
47538
- newEvent = _useState34[0],
47539
- setNewEvent = _useState34[1];
47540
- var _useState35 = React.useState([]),
47541
- _useState36 = _slicedToArray(_useState35, 2),
47542
- knownEvents = _useState36[0],
47543
- setKnownEvents = _useState36[1];
47544
- var _useState37 = React.useState(false),
47545
47605
  _useState38 = _slicedToArray(_useState37, 2),
47546
- saving = _useState38[0],
47547
- setSaving = _useState38[1];
47548
- var _useState39 = React.useState(null),
47606
+ subscriptions = _useState38[0],
47607
+ setSubscriptions = _useState38[1];
47608
+ var _useState39 = React.useState(""),
47549
47609
  _useState40 = _slicedToArray(_useState39, 2),
47550
- error = _useState40[0],
47551
- setError = _useState40[1];
47610
+ newEvent = _useState40[0],
47611
+ setNewEvent = _useState40[1];
47612
+ var _useState41 = React.useState([]),
47613
+ _useState42 = _slicedToArray(_useState41, 2),
47614
+ knownEvents = _useState42[0],
47615
+ setKnownEvents = _useState42[1];
47616
+ var _useState43 = React.useState(false),
47617
+ _useState44 = _slicedToArray(_useState43, 2),
47618
+ saving = _useState44[0],
47619
+ setSaving = _useState44[1];
47620
+ var _useState45 = React.useState(null),
47621
+ _useState46 = _slicedToArray(_useState45, 2),
47622
+ error = _useState46[0],
47623
+ setError = _useState46[1];
47552
47624
 
47553
47625
  // Discover recently-seen widget event types to suggest as subscriptions.
47554
47626
  React.useEffect(function () {
@@ -47564,29 +47636,32 @@ var BotDetail = function BotDetail(_ref) {
47564
47636
  };
47565
47637
  }, []);
47566
47638
 
47567
- // Discover the user's connected integrations for the picker.
47639
+ // Discover the user's configured MCP providers — running or not. The bot
47640
+ // starts any that aren't running when it runs.
47568
47641
  React.useEffect(function () {
47569
- var _api$llm;
47642
+ var _api$bots3;
47570
47643
  var alive = true;
47571
47644
  var api = getMainApi();
47572
- if (!(api !== null && api !== void 0 && (_api$llm = api.llm) !== null && _api$llm !== void 0 && _api$llm.listConnectedTools)) return undefined;
47573
- api.llm.listConnectedTools().then(function (servers) {
47574
- if (!alive || !Array.isArray(servers)) return;
47575
- setConnectedServers(servers.map(function (s) {
47576
- return s.serverName;
47577
- }).filter(Boolean));
47578
- })["catch"](function () {});
47645
+ if (!(api !== null && api !== void 0 && (_api$bots3 = api.bots) !== null && _api$bots3 !== void 0 && _api$bots3.listToolSources)) {
47646
+ setSourcesLoaded(true);
47647
+ return undefined;
47648
+ }
47649
+ Promise.resolve(api.bots.listToolSources((bot === null || bot === void 0 ? void 0 : bot.workspaceId) || null)).then(function (sources) {
47650
+ if (alive && Array.isArray(sources)) setToolSources(sources);
47651
+ })["catch"](function () {})["finally"](function () {
47652
+ if (alive) setSourcesLoaded(true);
47653
+ });
47579
47654
  return function () {
47580
47655
  alive = false;
47581
47656
  };
47582
- }, []);
47657
+ }, [bot === null || bot === void 0 ? void 0 : bot.workspaceId]);
47583
47658
 
47584
47659
  // Fetch the model list for the chosen provider.
47585
47660
  React.useEffect(function () {
47586
- var _api$llm2;
47661
+ var _api$llm;
47587
47662
  var alive = true;
47588
47663
  var api = getMainApi();
47589
- if (!(api !== null && api !== void 0 && (_api$llm2 = api.llm) !== null && _api$llm2 !== void 0 && _api$llm2.listModels)) {
47664
+ if (!(api !== null && api !== void 0 && (_api$llm = api.llm) !== null && _api$llm !== void 0 && _api$llm.listModels)) {
47590
47665
  setModelOptions([]);
47591
47666
  return undefined;
47592
47667
  }
@@ -47600,12 +47675,32 @@ var BotDetail = function BotDetail(_ref) {
47600
47675
  };
47601
47676
  }, [provider]);
47602
47677
 
47603
- // Union of connected servers + any the bot already has (so an attached server
47604
- // that isn't currently connected still shows, checked, and isn't dropped).
47605
- var availableServers = _toConsumableArray(new Set([].concat(_toConsumableArray(selectedServers || []), _toConsumableArray(connectedServers)))).map(function (serverName) {
47678
+ // Configured providers + any the bot already has (so a provider that was
47679
+ // since removed still shows, checked, and isn't silently dropped on save).
47680
+ var availableServers = [].concat(_toConsumableArray(toolSources.map(function (s) {
47681
+ return _objectSpread$t(_objectSpread$t({}, s), {}, {
47682
+ missing: false
47683
+ });
47684
+ })), _toConsumableArray((selectedServers || []).filter(function (name) {
47685
+ return !toolSources.some(function (s) {
47686
+ return s.name === name;
47687
+ });
47688
+ }).map(function (name) {
47606
47689
  return {
47607
- serverName: serverName,
47608
- label: prettyServer(serverName)
47690
+ name: name,
47691
+ running: false,
47692
+ toolCount: null,
47693
+ missing: true
47694
+ };
47695
+ }))).map(function (s) {
47696
+ var _s$toolCount;
47697
+ return {
47698
+ serverName: s.name,
47699
+ label: prettyServer(s.name),
47700
+ // The provider's declared tools (or live tools if undeclared + running);
47701
+ // null → every tool, list not known yet.
47702
+ tools: Array.isArray(s.tools) ? s.tools : null,
47703
+ status: s.missing ? "No longer set up under Settings → Providers" : s.running ? "Running \xB7 ".concat((_s$toolCount = s.toolCount) !== null && _s$toolCount !== void 0 ? _s$toolCount : 0, " tools") : "Starts when the bot runs"
47609
47704
  };
47610
47705
  });
47611
47706
  var modelSelectOptions = [{
@@ -47624,6 +47719,35 @@ var BotDetail = function BotDetail(_ref) {
47624
47719
  }) : [].concat(_toConsumableArray(prev), [serverName]);
47625
47720
  });
47626
47721
  };
47722
+
47723
+ // Is `tool` allowed for this bot on `serverName`? No stored selection → yes.
47724
+ var isToolOn = function isToolOn(serverName, tool) {
47725
+ var sel = toolSelections[serverName];
47726
+ return Array.isArray(sel) ? sel.includes(tool) : true;
47727
+ };
47728
+
47729
+ // Toggle one tool. Selecting every tool again clears the entry (= all), so
47730
+ // a later provider-side addition is picked up automatically.
47731
+ var toggleTool = function toggleTool(serverName, allTools, tool) {
47732
+ setToolSelections(function (prev) {
47733
+ var current = Array.isArray(prev[serverName]) ? prev[serverName] : _toConsumableArray(allTools);
47734
+ var next = current.includes(tool) ? current.filter(function (t) {
47735
+ return t !== tool;
47736
+ }) : allTools.filter(function (t) {
47737
+ return t === tool || current.includes(t);
47738
+ });
47739
+ var copy = _objectSpread$t({}, prev);
47740
+ if (next.length === allTools.length) delete copy[serverName];else copy[serverName] = next;
47741
+ return copy;
47742
+ });
47743
+ };
47744
+ var setAllTools = function setAllTools(serverName, on) {
47745
+ setToolSelections(function (prev) {
47746
+ var copy = _objectSpread$t({}, prev);
47747
+ if (on) delete copy[serverName];else copy[serverName] = [];
47748
+ return copy;
47749
+ });
47750
+ };
47627
47751
  var addSubscription = function addSubscription(eventType) {
47628
47752
  var ev = (eventType || "").trim();
47629
47753
  if (!ev) return;
@@ -47646,10 +47770,10 @@ var BotDetail = function BotDetail(_ref) {
47646
47770
  });
47647
47771
  var canSave = name.trim() && instructions.trim() && !saving;
47648
47772
  var handleSave = /*#__PURE__*/function () {
47649
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
47650
- var cron, schedules, definition, _t;
47651
- return _regeneratorRuntime.wrap(function (_context) {
47652
- while (1) switch (_context.prev = _context.next) {
47773
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
47774
+ var cron, schedules, definition, _t2;
47775
+ return _regeneratorRuntime.wrap(function (_context2) {
47776
+ while (1) switch (_context2.prev = _context2.next) {
47653
47777
  case 0:
47654
47778
  setError(null);
47655
47779
  cron = advanced ? advancedCron.trim() : buildCron({
@@ -47672,6 +47796,12 @@ var BotDetail = function BotDetail(_ref) {
47672
47796
  engine: engine || null,
47673
47797
  approvalPolicy: approvalPolicy,
47674
47798
  mcpServers: selectedServers,
47799
+ // Only keep narrowing for providers the bot still uses.
47800
+ toolSelections: Object.fromEntries(Object.entries(toolSelections).filter(function (_ref4) {
47801
+ var _ref5 = _slicedToArray(_ref4, 1),
47802
+ server = _ref5[0];
47803
+ return selectedServers.includes(server);
47804
+ })),
47675
47805
  schedules: schedules,
47676
47806
  subscriptions: subscriptions.map(function (eventType) {
47677
47807
  return {
@@ -47680,28 +47810,28 @@ var BotDetail = function BotDetail(_ref) {
47680
47810
  })
47681
47811
  });
47682
47812
  setSaving(true);
47683
- _context.prev = 1;
47684
- _context.next = 2;
47813
+ _context2.prev = 1;
47814
+ _context2.next = 2;
47685
47815
  return onSave(definition);
47686
47816
  case 2:
47687
- _context.next = 4;
47817
+ _context2.next = 4;
47688
47818
  break;
47689
47819
  case 3:
47690
- _context.prev = 3;
47691
- _t = _context["catch"](1);
47692
- setError(_t && _t.message || "Failed to save bot");
47820
+ _context2.prev = 3;
47821
+ _t2 = _context2["catch"](1);
47822
+ setError(_t2 && _t2.message || "Failed to save bot");
47693
47823
  case 4:
47694
- _context.prev = 4;
47824
+ _context2.prev = 4;
47695
47825
  setSaving(false);
47696
- return _context.finish(4);
47826
+ return _context2.finish(4);
47697
47827
  case 5:
47698
47828
  case "end":
47699
- return _context.stop();
47829
+ return _context2.stop();
47700
47830
  }
47701
- }, _callee, null, [[1, 3, 4, 5]]);
47831
+ }, _callee2, null, [[1, 3, 4, 5]]);
47702
47832
  }));
47703
47833
  return function handleSave() {
47704
- return _ref2.apply(this, arguments);
47834
+ return _ref3.apply(this, arguments);
47705
47835
  };
47706
47836
  }();
47707
47837
  var scheduleOn = advanced || frequency !== "off";
@@ -47730,57 +47860,132 @@ var BotDetail = function BotDetail(_ref) {
47730
47860
  placeholder: "What should this bot do?",
47731
47861
  rows: 5
47732
47862
  })]
47733
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47734
- className: "flex flex-col gap-1",
47735
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47736
- label: "Provider",
47737
- value: provider,
47738
- onChange: setProvider,
47739
- options: providerOptionsFrom(providers)
47740
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
47741
- className: "text-xs opacity-50",
47742
- children: "The AI that runs this bot. \"Claude Code (CLI)\" uses your Claude login \u2014 no API key needed."
47743
- })]
47744
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47745
- label: "Model",
47746
- value: model,
47747
- onChange: setModel,
47748
- options: modelSelectOptions,
47749
- placeholder: "Recommended (default)"
47750
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47751
- label: "Engine",
47752
- value: engine,
47753
- onChange: setEngine,
47754
- options: ENGINE_OPTIONS,
47755
- placeholder: "Standard (default)"
47756
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47757
- label: "Approval policy",
47758
- value: approvalPolicy,
47759
- onChange: setApprovalPolicy,
47760
- options: APPROVAL_OPTIONS
47761
47863
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47762
47864
  className: "flex flex-col gap-2",
47763
47865
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
47764
47866
  className: "text-sm font-medium",
47765
- children: "Tools & integrations"
47867
+ children: "Providers"
47868
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
47869
+ className: "text-xs opacity-50",
47870
+ children: "What this bot can use \u2014 your MCP providers from Settings \u2192 Providers. The bot starts any that aren't running when it runs."
47766
47871
  }), availableServers.length ? /*#__PURE__*/jsxRuntime.jsx("div", {
47767
47872
  className: "flex flex-col gap-1",
47768
47873
  children: availableServers.map(function (s) {
47769
- return /*#__PURE__*/jsxRuntime.jsx(DashReact.Checkbox, {
47770
- label: s.label,
47771
- checked: selectedServers.includes(s.serverName),
47772
- onChange: function onChange() {
47773
- return toggleServer(s.serverName);
47774
- }
47874
+ var on = selectedServers.includes(s.serverName);
47875
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
47876
+ className: "flex flex-col gap-1",
47877
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
47878
+ className: "flex flex-row items-center justify-between gap-3",
47879
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Checkbox, {
47880
+ label: s.label,
47881
+ checked: on,
47882
+ onChange: function onChange() {
47883
+ return toggleServer(s.serverName);
47884
+ }
47885
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
47886
+ className: "text-xs opacity-50",
47887
+ children: s.status
47888
+ })]
47889
+ }), on ? /*#__PURE__*/jsxRuntime.jsx("div", {
47890
+ className: "flex flex-col gap-1 pl-7 pb-2",
47891
+ children: s.tools && s.tools.length ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
47892
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
47893
+ className: "flex flex-row items-center gap-2",
47894
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
47895
+ className: "text-xs opacity-50",
47896
+ children: "Tools this bot may use (from the provider's allowed tools):"
47897
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
47898
+ title: "All",
47899
+ size: "xs",
47900
+ onClick: function onClick() {
47901
+ return setAllTools(s.serverName, true);
47902
+ }
47903
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
47904
+ title: "None",
47905
+ size: "xs",
47906
+ onClick: function onClick() {
47907
+ return setAllTools(s.serverName, false);
47908
+ }
47909
+ })]
47910
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
47911
+ className: "grid grid-cols-2 gap-x-4 gap-y-1",
47912
+ children: s.tools.map(function (tool) {
47913
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
47914
+ className: "flex flex-row items-center gap-2",
47915
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Checkbox, {
47916
+ label: prettyTool(tool),
47917
+ checked: isToolOn(s.serverName, tool),
47918
+ onChange: function onChange() {
47919
+ return toggleTool(s.serverName, s.tools, tool);
47920
+ }
47921
+ }), isRemembered(s.serverName, tool) ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
47922
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
47923
+ className: "text-xs opacity-60",
47924
+ children: "Always allowed"
47925
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
47926
+ title: "Revoke",
47927
+ size: "xs",
47928
+ ariaLabel: "Revoke always-allow for ".concat(prettyTool(tool)),
47929
+ tooltip: "Ask again before this tool runs",
47930
+ onClick: function onClick() {
47931
+ return revokeRemembered(s.serverName, tool);
47932
+ }
47933
+ })]
47934
+ }) : null]
47935
+ }, tool);
47936
+ })
47937
+ }), grants[s.serverName] && (grants[s.serverName].folders || []).length ? /*#__PURE__*/jsxRuntime.jsxs("span", {
47938
+ className: "text-xs opacity-50",
47939
+ children: ["Always-allowed folders:", " ", grants[s.serverName].folders.join(", ")]
47940
+ }) : null]
47941
+ }) : /*#__PURE__*/jsxRuntime.jsx("span", {
47942
+ className: "text-xs opacity-50",
47943
+ children: "All tools this provider offers \u2014 it has no tool limit set in Settings \u2192 Providers."
47944
+ })
47945
+ }) : null]
47775
47946
  }, s.serverName);
47776
47947
  })
47777
- }) : /*#__PURE__*/jsxRuntime.jsx("span", {
47948
+ }) : sourcesLoaded ? /*#__PURE__*/jsxRuntime.jsx("span", {
47778
47949
  className: "text-xs opacity-50",
47779
- children: "No connected integrations yet. Add one under Settings \u2192 MCP Server, then it will appear here."
47780
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
47950
+ children: "You haven't set up any MCP providers yet. Add one under Settings \u2192 Providers, then it will appear here."
47951
+ }) : null, /*#__PURE__*/jsxRuntime.jsx("span", {
47781
47952
  className: "text-xs opacity-50",
47782
- children: "Tools on these integrations route through the approval policy above."
47953
+ children: "Each tool call follows the approval policy below."
47783
47954
  })]
47955
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47956
+ className: "flex flex-col gap-2",
47957
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
47958
+ className: "text-sm font-medium",
47959
+ children: "AI model"
47960
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47961
+ className: "flex flex-col gap-1",
47962
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47963
+ label: "Model source",
47964
+ value: provider,
47965
+ onChange: setProvider,
47966
+ options: providerOptionsFrom(providers)
47967
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
47968
+ className: "text-xs opacity-50",
47969
+ children: "Which AI powers the bot \u2014 an API key from your Anthropic, OpenAI or xAI providers, or \"Claude Code (CLI)\", which uses your Claude login with no API key."
47970
+ })]
47971
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47972
+ label: "Model",
47973
+ value: model,
47974
+ onChange: setModel,
47975
+ options: modelSelectOptions,
47976
+ placeholder: "Recommended (default)"
47977
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47978
+ label: "Engine",
47979
+ value: engine,
47980
+ onChange: setEngine,
47981
+ options: ENGINE_OPTIONS,
47982
+ placeholder: "Standard (default)"
47983
+ })]
47984
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
47985
+ label: "Approval policy",
47986
+ value: approvalPolicy,
47987
+ onChange: setApprovalPolicy,
47988
+ options: APPROVAL_OPTIONS
47784
47989
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47785
47990
  className: "flex flex-col gap-2",
47786
47991
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {