@trops/dash-core 0.1.707 → 0.1.709

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
@@ -51968,12 +51968,20 @@ function ListenersTab(_ref1) {
51968
51968
  return m;
51969
51969
  }, [receivers]);
51970
51970
  if (receivers.length === 0) {
51971
+ // Bots are emitters too (component `bot:<ref>`) — count them apart.
51972
+ var botCount = emitters.filter(function (e) {
51973
+ return String(e.component || "").startsWith("bot:");
51974
+ }).length;
51975
+ var widgetCount = emitters.length - botCount;
51976
+ var senders = [widgetCount > 0 && "".concat(widgetCount, " widget").concat(widgetCount === 1 ? "" : "s"), botCount > 0 && "".concat(botCount, " bot").concat(botCount === 1 ? "" : "s")].filter(Boolean);
51971
51977
  return /*#__PURE__*/jsxRuntime.jsx("div", {
51972
51978
  className: "flex items-center justify-center h-full text-sm opacity-60 text-center",
51973
51979
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
51974
- children: ["No widgets in this dashboard declare event handlers.", emitters.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
51980
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
51981
+ children: "No widget on this dashboard can listen for events yet."
51982
+ }), senders.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
51975
51983
  className: "mt-2",
51976
- children: ["(", emitters.length, " widget", emitters.length === 1 ? "" : "s", " emit events but nothing is set up to receive.)"]
51984
+ children: "".concat(senders.join(" and "), " ").concat(emitters.length === 1 ? "sends" : "send", " events. Add a widget that listens to use them.")
51977
51985
  })]
51978
51986
  })
51979
51987
  });
@@ -59148,6 +59156,35 @@ function useNarrow(ref, forced) {
59148
59156
  }, [ref, forced]);
59149
59157
  return typeof forced === "boolean" ? forced : narrow;
59150
59158
  }
59159
+
59160
+ /** The view's content width (px), or 0 until measured. */
59161
+ function useContentWidth(ref) {
59162
+ var _useState3 = React.useState(0),
59163
+ _useState4 = _slicedToArray(_useState3, 2),
59164
+ width = _useState4[0],
59165
+ setWidth = _useState4[1];
59166
+ React.useEffect(function () {
59167
+ var el = ref.current;
59168
+ if (!el || typeof ResizeObserver === "undefined") return undefined;
59169
+ var ro = new ResizeObserver(function (_ref3) {
59170
+ var _ref4 = _slicedToArray(_ref3, 1),
59171
+ entry = _ref4[0];
59172
+ setWidth(Math.round(entry.contentRect.width));
59173
+ });
59174
+ ro.observe(el);
59175
+ return function () {
59176
+ return ro.disconnect();
59177
+ };
59178
+ }, [ref]);
59179
+ return width;
59180
+ }
59181
+
59182
+ // The bot panel beside the diagram (TEAM-014): the user drags its edge.
59183
+ // Starts at half; the diagram keeps DIAGRAM_MIN, the panel PANEL_MIN.
59184
+ var PANEL_WIDTH_KEY = "dash:botsView:panelWidth";
59185
+ var PANEL_GAP = 16; // gap-4 between the diagram and the panel
59186
+ var PANEL_MIN = 360;
59187
+ var DIAGRAM_MIN = 320;
59151
59188
  var TABS = ["conversation", "activity", "settings"];
59152
59189
 
59153
59190
  // Diagram / List (TEAM-014), remembered per viewer. Storage can be blocked.
@@ -59166,21 +59203,21 @@ var writeMode = function writeMode(mode) {
59166
59203
  // Not remembered — fine.
59167
59204
  }
59168
59205
  };
59169
- var BotsView = function BotsView(_ref3) {
59170
- var workspace = _ref3.workspace,
59171
- _ref3$workspaces = _ref3.workspaces,
59172
- workspaces = _ref3$workspaces === void 0 ? [] : _ref3$workspaces,
59173
- team = _ref3.team,
59174
- narrow = _ref3.narrow,
59175
- _ref3$focus = _ref3.focus,
59176
- focus = _ref3$focus === void 0 ? null : _ref3$focus,
59177
- _ref3$onDirtyChange = _ref3.onDirtyChange,
59178
- onDirtyChange = _ref3$onDirtyChange === void 0 ? null : _ref3$onDirtyChange,
59179
- _ref3$onOpenSettings = _ref3.onOpenSettings,
59180
- onOpenSettings = _ref3$onOpenSettings === void 0 ? null : _ref3$onOpenSettings;
59181
- var _ref4 = React.useContext(DashReact.ThemeContext) || {},
59182
- _ref4$currentTheme = _ref4.currentTheme,
59183
- currentTheme = _ref4$currentTheme === void 0 ? {} : _ref4$currentTheme;
59206
+ var BotsView = function BotsView(_ref5) {
59207
+ var workspace = _ref5.workspace,
59208
+ _ref5$workspaces = _ref5.workspaces,
59209
+ workspaces = _ref5$workspaces === void 0 ? [] : _ref5$workspaces,
59210
+ team = _ref5.team,
59211
+ narrow = _ref5.narrow,
59212
+ _ref5$focus = _ref5.focus,
59213
+ focus = _ref5$focus === void 0 ? null : _ref5$focus,
59214
+ _ref5$onDirtyChange = _ref5.onDirtyChange,
59215
+ onDirtyChange = _ref5$onDirtyChange === void 0 ? null : _ref5$onDirtyChange,
59216
+ _ref5$onOpenSettings = _ref5.onOpenSettings,
59217
+ onOpenSettings = _ref5$onOpenSettings === void 0 ? null : _ref5$onOpenSettings;
59218
+ var _ref6 = React.useContext(DashReact.ThemeContext) || {},
59219
+ _ref6$currentTheme = _ref6.currentTheme,
59220
+ currentTheme = _ref6$currentTheme === void 0 ? {} : _ref6$currentTheme;
59184
59221
  var appContext = React.useContext(AppContext);
59185
59222
  var providers = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || {};
59186
59223
  var muted = currentTheme["text-neutral-medium"] || "text-gray-400";
@@ -59190,6 +59227,17 @@ var BotsView = function BotsView(_ref3) {
59190
59227
  var strong = currentTheme["text-neutral-light"] || "text-gray-200";
59191
59228
  var rootRef = React.useRef(null);
59192
59229
  var isNarrow = useNarrow(rootRef, narrow);
59230
+ var contentWidth = useContentWidth(rootRef);
59231
+ var panelRoom = Math.max(0, contentWidth - PANEL_GAP);
59232
+ var _useResizableWidth = DashReact.useResizableWidth({
59233
+ defaultWidth: Math.round(panelRoom / 2),
59234
+ min: PANEL_MIN,
59235
+ max: panelRoom - DIAGRAM_MIN,
59236
+ edge: "left",
59237
+ storageKey: PANEL_WIDTH_KEY
59238
+ }),
59239
+ panelWidth = _useResizableWidth.width,
59240
+ panelHandle = _useResizableWidth.handleProps;
59193
59241
  var lead = team ? team.lead : null;
59194
59242
  var members = team ? team.members : [];
59195
59243
  var all = [lead].concat(_toConsumableArray(members)).filter(Boolean);
@@ -59197,91 +59245,91 @@ var BotsView = function BotsView(_ref3) {
59197
59245
  var focusTarget = focus && all.some(function (b) {
59198
59246
  return b.id === focus.botId;
59199
59247
  }) ? focus : null;
59200
- var _useState3 = React.useState(function () {
59248
+ var _useState5 = React.useState(function () {
59201
59249
  return focusTarget && focusTarget.botId || lead && lead.id || members[0] && members[0].id || null;
59202
59250
  }),
59203
- _useState4 = _slicedToArray(_useState3, 2),
59204
- selectedId = _useState4[0],
59205
- setSelectedId = _useState4[1];
59206
- var _useState5 = React.useState(function () {
59251
+ _useState6 = _slicedToArray(_useState5, 2),
59252
+ selectedId = _useState6[0],
59253
+ setSelectedId = _useState6[1];
59254
+ var _useState7 = React.useState(function () {
59207
59255
  return focusTarget && TABS.includes(focusTarget.tab) ? focusTarget.tab : "conversation";
59208
59256
  }),
59209
- _useState6 = _slicedToArray(_useState5, 2),
59210
- tab = _useState6[0],
59211
- setTab = _useState6[1];
59212
- var _useState7 = React.useState(false),
59213
59257
  _useState8 = _slicedToArray(_useState7, 2),
59214
- menuOpen = _useState8[0],
59215
- setMenuOpen = _useState8[1];
59258
+ tab = _useState8[0],
59259
+ setTab = _useState8[1];
59260
+ var _useState9 = React.useState(false),
59261
+ _useState0 = _slicedToArray(_useState9, 2),
59262
+ menuOpen = _useState0[0],
59263
+ setMenuOpen = _useState0[1];
59216
59264
  // Team diagram (TEAM-014): the view, and whether the selected bot's
59217
59265
  // Conversation / Activity / Settings is open beside the diagram (else its
59218
59266
  // summary is). A focus request (Open in Bots view) opens it.
59219
- var _useState9 = React.useState(readMode),
59220
- _useState0 = _slicedToArray(_useState9, 2),
59221
- mode = _useState0[0],
59222
- setModeState = _useState0[1];
59223
- var _useState1 = React.useState(function () {
59267
+ var _useState1 = React.useState(readMode),
59268
+ _useState10 = _slicedToArray(_useState1, 2),
59269
+ mode = _useState10[0],
59270
+ setModeState = _useState10[1];
59271
+ var _useState11 = React.useState(function () {
59224
59272
  return !!focusTarget;
59225
59273
  }),
59226
- _useState10 = _slicedToArray(_useState1, 2),
59227
- detailOpen = _useState10[0],
59228
- setDetailOpen = _useState10[1];
59274
+ _useState12 = _slicedToArray(_useState11, 2),
59275
+ detailOpen = _useState12[0],
59276
+ setDetailOpen = _useState12[1];
59229
59277
  var setMode = function setMode(next) {
59230
59278
  setModeState(next);
59231
59279
  writeMode(next);
59232
59280
  };
59233
59281
  // Team export/import (TEAM-006/007, slice 1): the review being shown, and
59234
59282
  // the last outcome ({ text, details?: string[] }).
59235
- var _useState11 = React.useState(null),
59236
- _useState12 = _slicedToArray(_useState11, 2),
59237
- importPreview = _useState12[0],
59238
- setImportPreview = _useState12[1];
59239
- var _useState13 = React.useState(false),
59283
+ var _useState13 = React.useState(null),
59240
59284
  _useState14 = _slicedToArray(_useState13, 2),
59241
- installing = _useState14[0],
59242
- setInstalling = _useState14[1];
59243
- var _useState15 = React.useState(null),
59285
+ importPreview = _useState14[0],
59286
+ setImportPreview = _useState14[1];
59287
+ var _useState15 = React.useState(false),
59244
59288
  _useState16 = _slicedToArray(_useState15, 2),
59245
- importError = _useState16[0],
59246
- setImportError = _useState16[1];
59289
+ installing = _useState16[0],
59290
+ setInstalling = _useState16[1];
59247
59291
  var _useState17 = React.useState(null),
59248
59292
  _useState18 = _slicedToArray(_useState17, 2),
59249
- teamNote = _useState18[0],
59250
- setTeamNote = _useState18[1];
59251
- // Registry install (TEAM-007 slice 3b): the search panel is open.
59252
- var _useState19 = React.useState(false),
59293
+ importError = _useState18[0],
59294
+ setImportError = _useState18[1];
59295
+ var _useState19 = React.useState(null),
59253
59296
  _useState20 = _slicedToArray(_useState19, 2),
59254
- registryOpen = _useState20[0],
59255
- setRegistryOpen = _useState20[1];
59297
+ teamNote = _useState20[0],
59298
+ setTeamNote = _useState20[1];
59299
+ // Registry install (TEAM-007 slice 3b): the search panel is open.
59300
+ var _useState21 = React.useState(false),
59301
+ _useState22 = _slicedToArray(_useState21, 2),
59302
+ registryOpen = _useState22[0],
59303
+ setRegistryOpen = _useState22[1];
59256
59304
  // Registry publish (TEAM-006 slice 3a): what's being published and how
59257
59305
  // it went.
59258
59306
  var _useRegistryAuthGate = useRegistryAuthGate(),
59259
59307
  ensureAuthed = _useRegistryAuthGate.ensureAuthed,
59260
59308
  authGate = _useRegistryAuthGate.authGate;
59261
- var _useState21 = React.useState(null),
59262
- _useState22 = _slicedToArray(_useState21, 2),
59263
- publishTarget = _useState22[0],
59264
- setPublishTarget = _useState22[1];
59265
59309
  var _useState23 = React.useState(null),
59266
59310
  _useState24 = _slicedToArray(_useState23, 2),
59267
- publishPreview = _useState24[0],
59268
- setPublishPreview = _useState24[1];
59269
- var _useState25 = React.useState(false),
59311
+ publishTarget = _useState24[0],
59312
+ setPublishTarget = _useState24[1];
59313
+ var _useState25 = React.useState(null),
59270
59314
  _useState26 = _slicedToArray(_useState25, 2),
59271
- publishing = _useState26[0],
59272
- setPublishing = _useState26[1];
59273
- var _useState27 = React.useState(null),
59315
+ publishPreview = _useState26[0],
59316
+ setPublishPreview = _useState26[1];
59317
+ var _useState27 = React.useState(false),
59274
59318
  _useState28 = _slicedToArray(_useState27, 2),
59275
- publishResult = _useState28[0],
59276
- setPublishResult = _useState28[1];
59319
+ publishing = _useState28[0],
59320
+ setPublishing = _useState28[1];
59277
59321
  var _useState29 = React.useState(null),
59278
59322
  _useState30 = _slicedToArray(_useState29, 2),
59279
- publishError = _useState30[0],
59280
- setPublishError = _useState30[1];
59281
- var _useState31 = React.useState([]),
59323
+ publishResult = _useState30[0],
59324
+ setPublishResult = _useState30[1];
59325
+ var _useState31 = React.useState(null),
59282
59326
  _useState32 = _slicedToArray(_useState31, 2),
59283
- allBots = _useState32[0],
59284
- setAllBots = _useState32[1];
59327
+ publishError = _useState32[0],
59328
+ setPublishError = _useState32[1];
59329
+ var _useState33 = React.useState([]),
59330
+ _useState34 = _slicedToArray(_useState33, 2),
59331
+ allBots = _useState34[0],
59332
+ setAllBots = _useState34[1];
59285
59333
  var _nameOf = React.useMemo(function () {
59286
59334
  var names = new Map(allBots.map(function (b) {
59287
59335
  return [b.id, b.name];
@@ -59301,18 +59349,18 @@ var BotsView = function BotsView(_ref3) {
59301
59349
  if (onDirtyRef.current) onDirtyRef.current(d);
59302
59350
  }, []);
59303
59351
  // Bumped by "Discard changes" to remount the form from the saved bot.
59304
- var _useState33 = React.useState(0),
59305
- _useState34 = _slicedToArray(_useState33, 2),
59306
- formKey = _useState34[0],
59307
- setFormKey = _useState34[1];
59308
- var _useState35 = React.useState(null),
59352
+ var _useState35 = React.useState(0),
59309
59353
  _useState36 = _slicedToArray(_useState35, 2),
59310
- pendingNav = _useState36[0],
59311
- setPendingNav = _useState36[1];
59312
- var _useState37 = React.useState(false),
59354
+ formKey = _useState36[0],
59355
+ setFormKey = _useState36[1];
59356
+ var _useState37 = React.useState(null),
59313
59357
  _useState38 = _slicedToArray(_useState37, 2),
59314
- confirmDelete = _useState38[0],
59315
- setConfirmDelete = _useState38[1];
59358
+ pendingNav = _useState38[0],
59359
+ setPendingNav = _useState38[1];
59360
+ var _useState39 = React.useState(false),
59361
+ _useState40 = _slicedToArray(_useState39, 2),
59362
+ confirmDelete = _useState40[0],
59363
+ setConfirmDelete = _useState40[1];
59316
59364
 
59317
59365
  // All bots (any dashboard) — the form's "Another bot" event source and
59318
59366
  // names for trigger chains. Reloaded when bots change anywhere.
@@ -59333,10 +59381,10 @@ var BotsView = function BotsView(_ref3) {
59333
59381
 
59334
59382
  // Providers' types and tools (TEAM-014): which tool events a bot can
59335
59383
  // trigger others on, in the diagram's trigger popover.
59336
- var _useState39 = React.useState([]),
59337
- _useState40 = _slicedToArray(_useState39, 2),
59338
- toolSources = _useState40[0],
59339
- setToolSources = _useState40[1];
59384
+ var _useState41 = React.useState([]),
59385
+ _useState42 = _slicedToArray(_useState41, 2),
59386
+ toolSources = _useState42[0],
59387
+ setToolSources = _useState42[1];
59340
59388
  var workspaceId = workspace ? workspace.id : null;
59341
59389
  React.useEffect(function () {
59342
59390
  var bots = api$6();
@@ -59462,12 +59510,12 @@ var BotsView = function BotsView(_ref3) {
59462
59510
  }) || null;
59463
59511
  };
59464
59512
  var saveTrigger = /*#__PURE__*/function () {
59465
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref5) {
59513
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref7) {
59466
59514
  var mode, sourceId, targetId, oldEventType, event, label, note, bots, source, target, next;
59467
59515
  return _regeneratorRuntime.wrap(function (_context) {
59468
59516
  while (1) switch (_context.prev = _context.next) {
59469
59517
  case 0:
59470
- mode = _ref5.mode, sourceId = _ref5.sourceId, targetId = _ref5.targetId, oldEventType = _ref5.oldEventType, event = _ref5.event, label = _ref5.label, note = _ref5.note;
59518
+ mode = _ref7.mode, sourceId = _ref7.sourceId, targetId = _ref7.targetId, oldEventType = _ref7.oldEventType, event = _ref7.event, label = _ref7.label, note = _ref7.note;
59471
59519
  bots = api$6();
59472
59520
  source = findBot(sourceId);
59473
59521
  _context.next = 1;
@@ -59495,16 +59543,16 @@ var BotsView = function BotsView(_ref3) {
59495
59543
  }, _callee);
59496
59544
  }));
59497
59545
  return function saveTrigger(_x) {
59498
- return _ref6.apply(this, arguments);
59546
+ return _ref8.apply(this, arguments);
59499
59547
  };
59500
59548
  }();
59501
59549
  var removeTriggerFrom = /*#__PURE__*/function () {
59502
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref7) {
59550
+ var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref9) {
59503
59551
  var targetId, eventType, bots, target;
59504
59552
  return _regeneratorRuntime.wrap(function (_context2) {
59505
59553
  while (1) switch (_context2.prev = _context2.next) {
59506
59554
  case 0:
59507
- targetId = _ref7.targetId, eventType = _ref7.eventType;
59555
+ targetId = _ref9.targetId, eventType = _ref9.eventType;
59508
59556
  bots = api$6();
59509
59557
  _context2.next = 1;
59510
59558
  return latestBot(targetId);
@@ -59530,13 +59578,13 @@ var BotsView = function BotsView(_ref3) {
59530
59578
  }, _callee2);
59531
59579
  }));
59532
59580
  return function removeTriggerFrom(_x2) {
59533
- return _ref8.apply(this, arguments);
59581
+ return _ref0.apply(this, arguments);
59534
59582
  };
59535
59583
  }();
59536
59584
  // The bot as saved right now (the view's copy can be behind a save made
59537
59585
  // elsewhere); falls back to the view's copy.
59538
59586
  var latestBot = /*#__PURE__*/function () {
59539
- var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
59587
+ var _ref1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
59540
59588
  var bots, fresh;
59541
59589
  return _regeneratorRuntime.wrap(function (_context3) {
59542
59590
  while (1) switch (_context3.prev = _context3.next) {
@@ -59566,13 +59614,13 @@ var BotsView = function BotsView(_ref3) {
59566
59614
  }, _callee3);
59567
59615
  }));
59568
59616
  return function latestBot(_x3) {
59569
- return _ref9.apply(this, arguments);
59617
+ return _ref1.apply(this, arguments);
59570
59618
  };
59571
59619
  }();
59572
59620
  var status = selected && team ? team.statusOf(selected.id) : "Idle";
59573
59621
  var statusDot = DOT[status] || DOT.Idle;
59574
59622
  var togglePause = /*#__PURE__*/function () {
59575
- var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
59623
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
59576
59624
  var bots;
59577
59625
  return _regeneratorRuntime.wrap(function (_context4) {
59578
59626
  while (1) switch (_context4.prev = _context4.next) {
@@ -59605,13 +59653,13 @@ var BotsView = function BotsView(_ref3) {
59605
59653
  }, _callee4);
59606
59654
  }));
59607
59655
  return function togglePause() {
59608
- return _ref0.apply(this, arguments);
59656
+ return _ref10.apply(this, arguments);
59609
59657
  };
59610
59658
  }();
59611
59659
 
59612
59660
  // Place a bot widget on this dashboard (TEAM-012) and say how it went.
59613
59661
  var showOnDashboard = /*#__PURE__*/function () {
59614
- var _ref1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(kind) {
59662
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(kind) {
59615
59663
  var bot,
59616
59664
  bots,
59617
59665
  r,
@@ -59655,11 +59703,11 @@ var BotsView = function BotsView(_ref3) {
59655
59703
  }, _callee5);
59656
59704
  }));
59657
59705
  return function showOnDashboard(_x4) {
59658
- return _ref1.apply(this, arguments);
59706
+ return _ref11.apply(this, arguments);
59659
59707
  };
59660
59708
  }();
59661
59709
  var saveBot = /*#__PURE__*/function () {
59662
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(definition) {
59710
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(definition) {
59663
59711
  var opts,
59664
59712
  bots,
59665
59713
  saved,
@@ -59702,21 +59750,21 @@ var BotsView = function BotsView(_ref3) {
59702
59750
  }, _callee6);
59703
59751
  }));
59704
59752
  return function saveBot(_x5) {
59705
- return _ref10.apply(this, arguments);
59753
+ return _ref12.apply(this, arguments);
59706
59754
  };
59707
59755
  }();
59708
59756
 
59709
59757
  // Discarding a draft (row ×, the draft form's button, its banner) asks
59710
59758
  // first; the lead can draft it again if asked.
59711
- var _useState41 = React.useState(null),
59712
- _useState42 = _slicedToArray(_useState41, 2),
59713
- discardTarget = _useState42[0],
59714
- setDiscardTarget = _useState42[1];
59759
+ var _useState43 = React.useState(null),
59760
+ _useState44 = _slicedToArray(_useState43, 2),
59761
+ discardTarget = _useState44[0],
59762
+ setDiscardTarget = _useState44[1];
59715
59763
  var discardDraft = function discardDraft() {
59716
59764
  if (selectedDraft) setDiscardTarget(selectedDraft);
59717
59765
  };
59718
59766
  var confirmDiscardDraft = /*#__PURE__*/function () {
59719
- var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
59767
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
59720
59768
  var d;
59721
59769
  return _regeneratorRuntime.wrap(function (_context7) {
59722
59770
  while (1) switch (_context7.prev = _context7.next) {
@@ -59745,7 +59793,7 @@ var BotsView = function BotsView(_ref3) {
59745
59793
  }, _callee7);
59746
59794
  }));
59747
59795
  return function confirmDiscardDraft() {
59748
- return _ref11.apply(this, arguments);
59796
+ return _ref13.apply(this, arguments);
59749
59797
  };
59750
59798
  }();
59751
59799
  var draftRow = function draftRow(d) {
@@ -59779,7 +59827,7 @@ var BotsView = function BotsView(_ref3) {
59779
59827
  }, id);
59780
59828
  };
59781
59829
  var removeFromTeam = /*#__PURE__*/function () {
59782
- var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
59830
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
59783
59831
  var bots;
59784
59832
  return _regeneratorRuntime.wrap(function (_context8) {
59785
59833
  while (1) switch (_context8.prev = _context8.next) {
@@ -59805,11 +59853,11 @@ var BotsView = function BotsView(_ref3) {
59805
59853
  }, _callee8);
59806
59854
  }));
59807
59855
  return function removeFromTeam() {
59808
- return _ref12.apply(this, arguments);
59856
+ return _ref14.apply(this, arguments);
59809
59857
  };
59810
59858
  }();
59811
59859
  var deleteBot = /*#__PURE__*/function () {
59812
- var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
59860
+ var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
59813
59861
  var bots;
59814
59862
  return _regeneratorRuntime.wrap(function (_context9) {
59815
59863
  while (1) switch (_context9.prev = _context9.next) {
@@ -59834,14 +59882,14 @@ var BotsView = function BotsView(_ref3) {
59834
59882
  }, _callee9);
59835
59883
  }));
59836
59884
  return function deleteBot() {
59837
- return _ref13.apply(this, arguments);
59885
+ return _ref15.apply(this, arguments);
59838
59886
  };
59839
59887
  }();
59840
59888
 
59841
59889
  // ─── Team export/import (TEAM-006/007, slice 1) ───────────────────
59842
59890
 
59843
59891
  var exportTeam = /*#__PURE__*/function () {
59844
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
59892
+ var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
59845
59893
  var bots, r, file, _t2;
59846
59894
  return _regeneratorRuntime.wrap(function (_context0) {
59847
59895
  while (1) switch (_context0.prev = _context0.next) {
@@ -59884,7 +59932,7 @@ var BotsView = function BotsView(_ref3) {
59884
59932
  }, _callee0);
59885
59933
  }));
59886
59934
  return function exportTeam() {
59887
- return _ref14.apply(this, arguments);
59935
+ return _ref16.apply(this, arguments);
59888
59936
  };
59889
59937
  }();
59890
59938
  var importTeam = function importTeam() {
@@ -59949,7 +59997,7 @@ var BotsView = function BotsView(_ref3) {
59949
59997
  // A registry package was picked: download, verify and check it in the
59950
59998
  // main process, then review it like an imported file.
59951
59999
  var pickRegistryPackage = /*#__PURE__*/function () {
59952
- var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(ref) {
60000
+ var _ref18 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(ref) {
59953
60001
  var bots, r, signedIn, _t4, _t5;
59954
60002
  return _regeneratorRuntime.wrap(function (_context10) {
59955
60003
  while (1) switch (_context10.prev = _context10.next) {
@@ -60020,11 +60068,11 @@ var BotsView = function BotsView(_ref3) {
60020
60068
  }, _callee10);
60021
60069
  }));
60022
60070
  return function pickRegistryPackage(_x6) {
60023
- return _ref16.apply(this, arguments);
60071
+ return _ref18.apply(this, arguments);
60024
60072
  };
60025
60073
  }();
60026
60074
  var installTeam = /*#__PURE__*/function () {
60027
- var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(choices) {
60075
+ var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(choices) {
60028
60076
  var roles,
60029
60077
  bots,
60030
60078
  r,
@@ -60093,11 +60141,11 @@ var BotsView = function BotsView(_ref3) {
60093
60141
  }, _callee11, null, [[2,, 9, 10]]);
60094
60142
  }));
60095
60143
  return function installTeam(_x7) {
60096
- return _ref17.apply(this, arguments);
60144
+ return _ref19.apply(this, arguments);
60097
60145
  };
60098
60146
  }();
60099
60147
  var openPublish = /*#__PURE__*/function () {
60100
- var _ref18 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(kind) {
60148
+ var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(kind) {
60101
60149
  var bots, signedIn, target, preview, _t8;
60102
60150
  return _regeneratorRuntime.wrap(function (_context12) {
60103
60151
  while (1) switch (_context12.prev = _context12.next) {
@@ -60161,11 +60209,11 @@ var BotsView = function BotsView(_ref3) {
60161
60209
  }, _callee12);
60162
60210
  }));
60163
60211
  return function openPublish(_x8) {
60164
- return _ref18.apply(this, arguments);
60212
+ return _ref20.apply(this, arguments);
60165
60213
  };
60166
60214
  }();
60167
60215
  var doPublish = /*#__PURE__*/function () {
60168
- var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(meta) {
60216
+ var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(meta) {
60169
60217
  var bots, r, _t9;
60170
60218
  return _regeneratorRuntime.wrap(function (_context13) {
60171
60219
  while (1) switch (_context13.prev = _context13.next) {
@@ -60210,7 +60258,7 @@ var BotsView = function BotsView(_ref3) {
60210
60258
  }, _callee13, null, [[2,, 5, 6]]);
60211
60259
  }));
60212
60260
  return function doPublish(_x9) {
60213
- return _ref19.apply(this, arguments);
60261
+ return _ref21.apply(this, arguments);
60214
60262
  };
60215
60263
  }();
60216
60264
  var closePublish = function closePublish() {
@@ -60264,7 +60312,7 @@ var BotsView = function BotsView(_ref3) {
60264
60312
  }) : null]
60265
60313
  });
60266
60314
  var turnOffLead = /*#__PURE__*/function () {
60267
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
60315
+ var _ref22 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
60268
60316
  var bots;
60269
60317
  return _regeneratorRuntime.wrap(function (_context14) {
60270
60318
  while (1) switch (_context14.prev = _context14.next) {
@@ -60288,11 +60336,11 @@ var BotsView = function BotsView(_ref3) {
60288
60336
  }, _callee14);
60289
60337
  }));
60290
60338
  return function turnOffLead() {
60291
- return _ref20.apply(this, arguments);
60339
+ return _ref22.apply(this, arguments);
60292
60340
  };
60293
60341
  }();
60294
60342
  var turnOnLead = /*#__PURE__*/function () {
60295
- var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
60343
+ var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
60296
60344
  var bots;
60297
60345
  return _regeneratorRuntime.wrap(function (_context15) {
60298
60346
  while (1) switch (_context15.prev = _context15.next) {
@@ -60315,7 +60363,7 @@ var BotsView = function BotsView(_ref3) {
60315
60363
  }, _callee15);
60316
60364
  }));
60317
60365
  return function turnOnLead() {
60318
- return _ref21.apply(this, arguments);
60366
+ return _ref23.apply(this, arguments);
60319
60367
  };
60320
60368
  }();
60321
60369
  var row = function row(b) {
@@ -60478,6 +60526,9 @@ var BotsView = function BotsView(_ref3) {
60478
60526
  // The diagram with the summary / bot detail beside it (wide windows only;
60479
60527
  // narrow windows keep the bot picker).
60480
60528
  var sideBySide = diagramMode && !isNarrow;
60529
+ // Its width is the user's once the view has been measured and has room
60530
+ // for both minimums.
60531
+ var resizable = sideBySide && panelRoom >= PANEL_MIN + DIAGRAM_MIN;
60481
60532
  var picker = /*#__PURE__*/jsxRuntime.jsx("div", {
60482
60533
  className: "flex flex-row items-end gap-2",
60483
60534
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -60542,163 +60593,179 @@ var BotsView = function BotsView(_ref3) {
60542
60593
  },
60543
60594
  onRunNow: runNow
60544
60595
  })
60545
- }) : /*#__PURE__*/jsxRuntime.jsxs("section", {
60546
- "aria-label": "Selected bot",
60547
- className: "".concat(sideBySide ? "w-1/2 flex-shrink-0" : "flex-1", " min-w-0 min-h-0 flex flex-col rounded-xl border ").concat(hairline),
60548
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60549
- className: "flex flex-row items-start justify-between gap-4 px-5 pt-4",
60596
+ }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
60597
+ children: [resizable ?
60598
+ /*#__PURE__*/
60599
+ // Sits in the gap: the negative margins keep the gap 16px.
60600
+ jsxRuntime.jsx("div", {
60601
+ className: "flex flex-row",
60602
+ style: {
60603
+ margin: "0 -12px"
60604
+ },
60605
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.ResizeHandle, _objectSpread$u(_objectSpread$u({}, panelHandle), {}, {
60606
+ ariaLabel: "Resize bot panel"
60607
+ }))
60608
+ }) : null, /*#__PURE__*/jsxRuntime.jsxs("section", {
60609
+ "aria-label": "Selected bot",
60610
+ className: "".concat(resizable ? "flex-shrink-0" : sideBySide ? "w-1/2 flex-shrink-0" : "flex-1", " min-w-0 min-h-0 flex flex-col rounded-xl border ").concat(hairline),
60611
+ style: resizable ? {
60612
+ width: panelWidth
60613
+ } : undefined,
60550
60614
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60551
- className: "min-w-0",
60615
+ className: "flex flex-row items-start justify-between gap-4 px-5 pt-4",
60552
60616
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60553
- className: "flex flex-row items-center gap-2",
60554
- children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
60555
- className: "text-lg font-semibold truncate",
60556
- children: selected ? selected.name : selectedDraft ? selectedDraft.definition.name : "New bot"
60557
- }), selected ? /*#__PURE__*/jsxRuntime.jsxs("span", {
60558
- className: "flex flex-row items-center gap-1.5 text-xs ".concat(muted),
60559
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
60560
- className: "h-2 w-2 rounded-full ".concat(statusDot)
60561
- }), status]
60617
+ className: "min-w-0",
60618
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60619
+ className: "flex flex-row items-center gap-2",
60620
+ children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
60621
+ className: "text-lg font-semibold truncate",
60622
+ children: selected ? selected.name : selectedDraft ? selectedDraft.definition.name : "New bot"
60623
+ }), selected ? /*#__PURE__*/jsxRuntime.jsxs("span", {
60624
+ className: "flex flex-row items-center gap-1.5 text-xs ".concat(muted),
60625
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
60626
+ className: "h-2 w-2 rounded-full ".concat(statusDot)
60627
+ }), status]
60628
+ }) : null]
60629
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
60630
+ className: "text-sm ".concat(muted),
60631
+ children: selected ? isLead ? "Answers questions about this team · costs nothing until asked" : [(selected.mcpServers || []).join(", "), triggerSummary(selected), selected.installedFrom ? "From ".concat(selected.installedFrom["package"], " v").concat(selected.installedFrom.version) : null].filter(Boolean).join(" · ") : "Joins the ".concat(workspace ? workspace.name : "dashboard", " team")
60632
+ })]
60633
+ }), selected ? /*#__PURE__*/jsxRuntime.jsxs("div", {
60634
+ className: "flex flex-row items-center gap-2 flex-shrink-0",
60635
+ children: [!isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
60636
+ title: "Run now",
60637
+ size: "sm",
60638
+ onClick: runNow
60639
+ }) : null, !isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60640
+ title: status === "Paused" ? "Resume" : "Pause",
60641
+ size: "sm",
60642
+ onClick: togglePause
60643
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60644
+ title: "\u22EF",
60645
+ size: "sm",
60646
+ ariaLabel: "More actions",
60647
+ onClick: function onClick() {
60648
+ return setMenuOpen(function (v) {
60649
+ return !v;
60650
+ });
60651
+ }
60652
+ }), sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60653
+ icon: "xmark",
60654
+ size: "sm",
60655
+ ariaLabel: "Back to summary",
60656
+ onClick: closeDetail
60562
60657
  }) : null]
60563
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
60564
- className: "text-sm ".concat(muted),
60565
- children: selected ? isLead ? "Answers questions about this team · costs nothing until asked" : [(selected.mcpServers || []).join(", "), triggerSummary(selected), selected.installedFrom ? "From ".concat(selected.installedFrom["package"], " v").concat(selected.installedFrom.version) : null].filter(Boolean).join(" · ") : "Joins the ".concat(workspace ? workspace.name : "dashboard", " team")
60566
- })]
60567
- }), selected ? /*#__PURE__*/jsxRuntime.jsxs("div", {
60568
- className: "flex flex-row items-center gap-2 flex-shrink-0",
60569
- children: [!isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
60570
- title: "Run now",
60571
- size: "sm",
60572
- onClick: runNow
60573
- }) : null, !isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60574
- title: status === "Paused" ? "Resume" : "Pause",
60575
- size: "sm",
60576
- onClick: togglePause
60577
- }) : null, /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60578
- title: "\u22EF",
60579
- size: "sm",
60580
- ariaLabel: "More actions",
60581
- onClick: function onClick() {
60582
- return setMenuOpen(function (v) {
60583
- return !v;
60584
- });
60585
- }
60586
- }), sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60658
+ }) : sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60587
60659
  icon: "xmark",
60588
60660
  size: "sm",
60589
- ariaLabel: "Back to summary",
60661
+ ariaLabel: "Close",
60590
60662
  onClick: closeDetail
60591
60663
  }) : null]
60592
- }) : sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60593
- icon: "xmark",
60594
- size: "sm",
60595
- ariaLabel: "Close",
60596
- onClick: closeDetail
60597
- }) : null]
60598
- }), menuOpen && selected ? /*#__PURE__*/jsxRuntime.jsx("div", {
60599
- className: "flex flex-row justify-end gap-2 px-5 pt-2",
60600
- children: isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60601
- title: "Turn off lead",
60602
- size: "xs",
60603
- onClick: turnOffLead
60604
- }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
60605
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60606
- title: "Show on dashboard",
60664
+ }), menuOpen && selected ? /*#__PURE__*/jsxRuntime.jsx("div", {
60665
+ className: "flex flex-row justify-end gap-2 px-5 pt-2",
60666
+ children: isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60667
+ title: "Turn off lead",
60607
60668
  size: "xs",
60608
- onClick: function onClick() {
60609
- return showOnDashboard("results", selected);
60610
- }
60611
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60612
- title: "Publish bot\u2026",
60613
- size: "xs",
60614
- onClick: function onClick() {
60615
- return openPublish("bot");
60616
- }
60617
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60618
- title: "Remove from team",
60619
- size: "xs",
60620
- onClick: removeFromTeam
60621
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60622
- title: "Delete",
60623
- size: "xs",
60624
- onClick: function onClick() {
60625
- return setConfirmDelete(true);
60626
- }
60627
- })]
60628
- })
60629
- }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
60630
- role: "tablist",
60631
- className: "flex flex-row gap-6 px-5 mt-3 border-b ".concat(hairline),
60632
- children: tabs.map(function (_ref22) {
60633
- var _ref23 = _slicedToArray(_ref22, 2),
60634
- id = _ref23[0],
60635
- label = _ref23[1];
60636
- return /*#__PURE__*/jsxRuntime.jsx("button", {
60637
- type: "button",
60638
- role: "tab",
60639
- "aria-selected": tab === id,
60640
- onClick: function onClick() {
60641
- return switchTab(id);
60642
- },
60643
- className: "py-2.5 text-sm font-medium -mb-px border-b-2 ".concat(tab === id ? "border-indigo-400" : "border-transparent ".concat(muted)),
60644
- children: label
60645
- }, id);
60646
- })
60647
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
60648
- className: "flex-1 min-h-0 flex flex-col",
60649
- children: [tab === "conversation" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotChat, {
60650
- bot: selected,
60651
- isLead: isLead,
60652
- approvals: team ? team.approvalsFor(selected.id) : [],
60653
- onApprove: team ? team.approve : null,
60654
- nameOf: _nameOf,
60655
- onOpenSettings: onOpenSettings,
60656
- onChangeModel: function onChangeModel() {
60657
- return switchTab("settings");
60658
- },
60659
- drafts: isLead ? drafts : undefined,
60660
- onOpenDraft: isLead ? function (id) {
60661
- return select(DRAFT_PREFIX + id);
60662
- } : null
60663
- }) : null, tab === "activity" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotRunHistory, {
60664
- bot: selected,
60665
- isLead: isLead,
60666
- nameOf: _nameOf,
60667
- onOpenSettings: onOpenSettings,
60668
- onChangeModel: function onChangeModel() {
60669
- return switchTab("settings");
60670
- }
60671
- }) : null, tab === "settings" ? /*#__PURE__*/jsxRuntime.jsx("div", {
60669
+ onClick: turnOffLead
60670
+ }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
60671
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60672
+ title: "Show on dashboard",
60673
+ size: "xs",
60674
+ onClick: function onClick() {
60675
+ return showOnDashboard("results", selected);
60676
+ }
60677
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60678
+ title: "Publish bot\u2026",
60679
+ size: "xs",
60680
+ onClick: function onClick() {
60681
+ return openPublish("bot");
60682
+ }
60683
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60684
+ title: "Remove from team",
60685
+ size: "xs",
60686
+ onClick: removeFromTeam
60687
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60688
+ title: "Delete",
60689
+ size: "xs",
60690
+ onClick: function onClick() {
60691
+ return setConfirmDelete(true);
60692
+ }
60693
+ })]
60694
+ })
60695
+ }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
60696
+ role: "tablist",
60697
+ className: "flex flex-row gap-6 px-5 mt-3 border-b ".concat(hairline),
60698
+ children: tabs.map(function (_ref24) {
60699
+ var _ref25 = _slicedToArray(_ref24, 2),
60700
+ id = _ref25[0],
60701
+ label = _ref25[1];
60702
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
60703
+ type: "button",
60704
+ role: "tab",
60705
+ "aria-selected": tab === id,
60706
+ onClick: function onClick() {
60707
+ return switchTab(id);
60708
+ },
60709
+ className: "py-2.5 text-sm font-medium -mb-px border-b-2 ".concat(tab === id ? "border-indigo-400" : "border-transparent ".concat(muted)),
60710
+ children: label
60711
+ }, id);
60712
+ })
60713
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
60672
60714
  className: "flex-1 min-h-0 flex flex-col",
60673
- children: /*#__PURE__*/jsxRuntime.jsx(BotDetail
60674
- // The lead's banner scrolls with the form (not pinned).
60675
- , {
60676
- header: selectedDraft ? /*#__PURE__*/jsxRuntime.jsx(DraftBanner, {
60677
- draft: selectedDraft,
60678
- onDiscard: discardDraft,
60679
- onOpenSettings: onOpenSettings
60680
- }) : null,
60681
- bot: selected || selectedDraft && selectedDraft.definition || null,
60682
- isCreating: !selected,
60683
- suggestions: selectedDraft ? selectedDraft.suggestions : null,
60684
- gaps: selectedDraft ? selectedDraft.gaps : null,
60685
- defaultWorkspaceId: workspace ? workspace.id : null,
60686
- providers: providers,
60687
- workspaces: workspaces,
60688
- getWidgetConfig: getWidgetConfig$4,
60689
- bots: allBots,
60690
- onSave: saveBot,
60691
- canShowOnDashboard: !!workspace,
60692
- onDirtyChange: setDirty,
60693
- onDiscardDraft: selectedDraft ? discardDraft : null,
60694
- onDiscard: function onDiscard() {
60695
- setDirty(false);
60696
- setFormKey(function (k) {
60697
- return k + 1;
60698
- });
60715
+ children: [tab === "conversation" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotChat, {
60716
+ bot: selected,
60717
+ isLead: isLead,
60718
+ approvals: team ? team.approvalsFor(selected.id) : [],
60719
+ onApprove: team ? team.approve : null,
60720
+ nameOf: _nameOf,
60721
+ onOpenSettings: onOpenSettings,
60722
+ onChangeModel: function onChangeModel() {
60723
+ return switchTab("settings");
60724
+ },
60725
+ drafts: isLead ? drafts : undefined,
60726
+ onOpenDraft: isLead ? function (id) {
60727
+ return select(DRAFT_PREFIX + id);
60728
+ } : null
60729
+ }) : null, tab === "activity" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotRunHistory, {
60730
+ bot: selected,
60731
+ isLead: isLead,
60732
+ nameOf: _nameOf,
60733
+ onOpenSettings: onOpenSettings,
60734
+ onChangeModel: function onChangeModel() {
60735
+ return switchTab("settings");
60699
60736
  }
60700
- }, "".concat(selected ? selected.id : selectedId || NEW_BOT, "-").concat(formKey))
60701
- }) : null]
60737
+ }) : null, tab === "settings" ? /*#__PURE__*/jsxRuntime.jsx("div", {
60738
+ className: "flex-1 min-h-0 flex flex-col",
60739
+ children: /*#__PURE__*/jsxRuntime.jsx(BotDetail
60740
+ // The lead's banner scrolls with the form (not pinned).
60741
+ , {
60742
+ header: selectedDraft ? /*#__PURE__*/jsxRuntime.jsx(DraftBanner, {
60743
+ draft: selectedDraft,
60744
+ onDiscard: discardDraft,
60745
+ onOpenSettings: onOpenSettings
60746
+ }) : null,
60747
+ bot: selected || selectedDraft && selectedDraft.definition || null,
60748
+ isCreating: !selected,
60749
+ suggestions: selectedDraft ? selectedDraft.suggestions : null,
60750
+ gaps: selectedDraft ? selectedDraft.gaps : null,
60751
+ defaultWorkspaceId: workspace ? workspace.id : null,
60752
+ providers: providers,
60753
+ workspaces: workspaces,
60754
+ getWidgetConfig: getWidgetConfig$4,
60755
+ bots: allBots,
60756
+ onSave: saveBot,
60757
+ canShowOnDashboard: !!workspace,
60758
+ onDirtyChange: setDirty,
60759
+ onDiscardDraft: selectedDraft ? discardDraft : null,
60760
+ onDiscard: function onDiscard() {
60761
+ setDirty(false);
60762
+ setFormKey(function (k) {
60763
+ return k + 1;
60764
+ });
60765
+ }
60766
+ }, "".concat(selected ? selected.id : selectedId || NEW_BOT, "-").concat(formKey))
60767
+ }) : null]
60768
+ })]
60702
60769
  })]
60703
60770
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.ConfirmationModal, {
60704
60771
  isOpen: !!pendingNav,