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