@burtson-labs/bandit-engine 2.0.20 → 2.0.22

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.
Files changed (32) hide show
  1. package/dist/{chat-2Y72EFJ2.mjs → chat-VOVYLTMX.mjs} +4 -4
  2. package/dist/chat-provider.js +22 -1
  3. package/dist/chat-provider.js.map +1 -1
  4. package/dist/chat-provider.mjs +3 -3
  5. package/dist/{chunk-XEG45Q6V.mjs → chunk-GBANNFRD.mjs} +2 -2
  6. package/dist/{chunk-JECYIAWF.mjs → chunk-LB7QYC56.mjs} +6 -6
  7. package/dist/{chunk-L7UOQ2Y2.mjs → chunk-LG2JCTOE.mjs} +3 -3
  8. package/dist/{chunk-2ZNIQD26.mjs → chunk-N3G5XPCA.mjs} +2 -2
  9. package/dist/{chunk-UMPVXYVC.mjs → chunk-XD5VJCFN.mjs} +23 -2
  10. package/dist/chunk-XD5VJCFN.mjs.map +1 -0
  11. package/dist/{chunk-CY227I4F.mjs → chunk-XVWKFDTD.mjs} +3 -3
  12. package/dist/{chunk-6V2YMAX2.mjs → chunk-ZRTP2N7E.mjs} +74 -24
  13. package/dist/{chunk-6V2YMAX2.mjs.map → chunk-ZRTP2N7E.mjs.map} +1 -1
  14. package/dist/cli/cli.js +1 -1
  15. package/dist/cli/cli.js.map +1 -1
  16. package/dist/index.js +89 -19
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +7 -7
  19. package/dist/management/management.js +89 -19
  20. package/dist/management/management.js.map +1 -1
  21. package/dist/management/management.mjs +5 -5
  22. package/dist/modals/chat-modal/chat-modal.js +22 -1
  23. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  24. package/dist/modals/chat-modal/chat-modal.mjs +3 -3
  25. package/package.json +1 -1
  26. package/dist/chunk-UMPVXYVC.mjs.map +0 -1
  27. /package/dist/{chat-2Y72EFJ2.mjs.map → chat-VOVYLTMX.mjs.map} +0 -0
  28. /package/dist/{chunk-XEG45Q6V.mjs.map → chunk-GBANNFRD.mjs.map} +0 -0
  29. /package/dist/{chunk-JECYIAWF.mjs.map → chunk-LB7QYC56.mjs.map} +0 -0
  30. /package/dist/{chunk-L7UOQ2Y2.mjs.map → chunk-LG2JCTOE.mjs.map} +0 -0
  31. /package/dist/{chunk-2ZNIQD26.mjs.map → chunk-N3G5XPCA.mjs.map} +0 -0
  32. /package/dist/{chunk-CY227I4F.mjs.map → chunk-XVWKFDTD.mjs.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ONQMRE2G.mjs";
4
4
  import {
5
5
  aiProviderInitService
6
- } from "./chunk-2ZNIQD26.mjs";
6
+ } from "./chunk-N3G5XPCA.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
9
  } from "./chunk-RTQDQ6TC.mjs";
@@ -20,7 +20,7 @@ import {
20
20
  useKnowledgeStore2,
21
21
  useMemoryStore,
22
22
  useProjectStore
23
- } from "./chunk-UMPVXYVC.mjs";
23
+ } from "./chunk-XD5VJCFN.mjs";
24
24
  import {
25
25
  indexedDBService_default,
26
26
  useModelStore,
@@ -157,4 +157,4 @@ export {
157
157
  ChatProvider,
158
158
  chat_provider_default
159
159
  };
160
- //# sourceMappingURL=chunk-CY227I4F.mjs.map
160
+ //# sourceMappingURL=chunk-XVWKFDTD.mjs.map
@@ -19,7 +19,7 @@ import {
19
19
  useNotificationService,
20
20
  useTTS,
21
21
  useVoiceStore
22
- } from "./chunk-XEG45Q6V.mjs";
22
+ } from "./chunk-GBANNFRD.mjs";
23
23
  import {
24
24
  authenticationService,
25
25
  brandingService_default,
@@ -43,7 +43,7 @@ import {
43
43
  useMemoryStore,
44
44
  useProjectStore,
45
45
  useVectorStore
46
- } from "./chunk-UMPVXYVC.mjs";
46
+ } from "./chunk-XD5VJCFN.mjs";
47
47
  import {
48
48
  indexedDBService_default,
49
49
  useModelStore,
@@ -6144,7 +6144,8 @@ import {
6144
6144
  Button as Button5,
6145
6145
  AppBar,
6146
6146
  Toolbar,
6147
- Avatar as Avatar7
6147
+ Avatar as Avatar7,
6148
+ Chip as Chip3
6148
6149
  } from "@mui/material";
6149
6150
  import {
6150
6151
  Close as CloseIcon6,
@@ -6217,6 +6218,7 @@ var EnhancedMobileConversationsModal = ({
6217
6218
  const [moveModalOpen, setMoveModalOpen] = useState12(false);
6218
6219
  const [conversationToMove, setConversationToMove] = useState12(null);
6219
6220
  const [renameProjectId, setRenameProjectId] = useState12(null);
6221
+ const [deletedConversationIds, setDeletedConversationIds] = useState12(/* @__PURE__ */ new Set());
6220
6222
  const [touchDragState, setTouchDragState] = useState12({ conversationId: null, originProjectId: null, hoverProjectId: null });
6221
6223
  const [avatarImage, setAvatarImage] = useState12(BANDIT_AVATAR2);
6222
6224
  const getCustomClaim = useCallback5((key) => {
@@ -6288,20 +6290,19 @@ var EnhancedMobileConversationsModal = ({
6288
6290
  }
6289
6291
  }, [projectsHydrated, projects]);
6290
6292
  const projectGroups = useMemo3(() => {
6291
- const groups = [];
6292
- projects.forEach((project) => {
6293
- const projectConversations = getConversationsByProject(project.id).map((conversation) => ({
6293
+ const visibleConversations = conversations.filter(
6294
+ (conversation) => !deletedConversationIds.has(conversation.id)
6295
+ );
6296
+ const groups = projects.map((project) => ({
6297
+ id: project.id,
6298
+ name: project.name,
6299
+ color: project.color,
6300
+ conversations: visibleConversations.filter((conversation) => conversation.projectId === project.id).map((conversation) => ({
6294
6301
  ...conversation
6295
- }));
6296
- groups.push({
6297
- id: project.id,
6298
- name: project.name,
6299
- color: project.color,
6300
- conversations: projectConversations,
6301
- collapsed: collapsedProjects.has(project.id)
6302
- });
6303
- });
6304
- const ungroupedConversations = getConversationsByProject(null).map((conversation) => ({
6302
+ })),
6303
+ collapsed: collapsedProjects.has(project.id)
6304
+ }));
6305
+ const ungroupedConversations = visibleConversations.filter((conversation) => !conversation.projectId).map((conversation) => ({
6305
6306
  ...conversation
6306
6307
  }));
6307
6308
  if (ungroupedConversations.length > 0) {
@@ -6310,11 +6311,14 @@ var EnhancedMobileConversationsModal = ({
6310
6311
  name: "Ungrouped",
6311
6312
  conversations: ungroupedConversations,
6312
6313
  collapsed: false
6313
- // Never collapsed for ungrouped
6314
6314
  });
6315
6315
  }
6316
6316
  return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
6317
- }, [projects, getConversationsByProject, collapsedProjects]);
6317
+ }, [projects, conversations, collapsedProjects, deletedConversationIds]);
6318
+ const visibleConversationCount = useMemo3(
6319
+ () => projectGroups.reduce((total, group) => total + group.conversations.length, 0),
6320
+ [projectGroups]
6321
+ );
6318
6322
  const filteredProjectGroups = useMemo3(() => {
6319
6323
  if (!searchQuery.trim()) return projectGroups;
6320
6324
  const query = searchQuery.toLowerCase();
@@ -6425,6 +6429,7 @@ var EnhancedMobileConversationsModal = ({
6425
6429
  };
6426
6430
  const handleClearAllConfirm = async () => {
6427
6431
  try {
6432
+ setDeletedConversationIds(new Set(conversations.map((conv) => conv.id)));
6428
6433
  await clearAllConversations();
6429
6434
  setClearConfirmOpen(false);
6430
6435
  handleMenuClose();
@@ -6443,6 +6448,21 @@ var EnhancedMobileConversationsModal = ({
6443
6448
  setMoveModalOpen(false);
6444
6449
  setConversationToMove(null);
6445
6450
  };
6451
+ useEffect11(() => {
6452
+ setDeletedConversationIds((prev) => {
6453
+ let changed = false;
6454
+ const active = new Set(conversations.map((conv) => conv.id));
6455
+ const next = /* @__PURE__ */ new Set();
6456
+ prev.forEach((id) => {
6457
+ if (active.has(id)) {
6458
+ next.add(id);
6459
+ } else {
6460
+ changed = true;
6461
+ }
6462
+ });
6463
+ return changed ? next : prev;
6464
+ });
6465
+ }, [conversations]);
6446
6466
  return /* @__PURE__ */ jsxs10(Fragment7, { children: [
6447
6467
  /* @__PURE__ */ jsx13(
6448
6468
  Modal2,
@@ -6479,6 +6499,19 @@ var EnhancedMobileConversationsModal = ({
6479
6499
  },
6480
6500
  children: /* @__PURE__ */ jsxs10(Toolbar, { children: [
6481
6501
  /* @__PURE__ */ jsx13(Typography7, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
6502
+ visibleConversationCount > 0 && /* @__PURE__ */ jsx13(
6503
+ Chip3,
6504
+ {
6505
+ label: visibleConversationCount,
6506
+ size: "small",
6507
+ sx: {
6508
+ mr: 1,
6509
+ bgcolor: theme.palette.mode === "dark" ? "rgba(148, 163, 184, 0.16)" : "rgba(15, 23, 42, 0.08)",
6510
+ color: theme.palette.text.secondary,
6511
+ fontWeight: 600
6512
+ }
6513
+ }
6514
+ ),
6482
6515
  /* @__PURE__ */ jsx13(
6483
6516
  IconButton9,
6484
6517
  {
@@ -6789,7 +6822,15 @@ var EnhancedMobileConversationsModal = ({
6789
6822
  switchConversation(conversation.id);
6790
6823
  onClose();
6791
6824
  },
6792
- onDelete: () => deleteConversation(conversation.id),
6825
+ onDelete: () => {
6826
+ setDeletedConversationIds((prev) => {
6827
+ if (prev.has(conversation.id)) return prev;
6828
+ const next = new Set(prev);
6829
+ next.add(conversation.id);
6830
+ return next;
6831
+ });
6832
+ deleteConversation(conversation.id);
6833
+ },
6793
6834
  onRename: (newName) => renameConversation(conversation.id, newName),
6794
6835
  onMove: () => handleMoveConversation(conversation),
6795
6836
  projectColor: group.color,
@@ -6832,7 +6873,15 @@ var EnhancedMobileConversationsModal = ({
6832
6873
  switchConversation(conversation.id);
6833
6874
  onClose();
6834
6875
  },
6835
- onDelete: () => deleteConversation(conversation.id),
6876
+ onDelete: () => {
6877
+ setDeletedConversationIds((prev) => {
6878
+ if (prev.has(conversation.id)) return prev;
6879
+ const next = new Set(prev);
6880
+ next.add(conversation.id);
6881
+ return next;
6882
+ });
6883
+ deleteConversation(conversation.id);
6884
+ },
6836
6885
  onRename: (newName) => renameConversation(conversation.id, newName),
6837
6886
  onMove: () => handleMoveConversation(conversation),
6838
6887
  projectColor: group.color,
@@ -6978,6 +7027,7 @@ var EnhancedMobileConversationsModal = ({
6978
7027
  setClearConfirmOpen(true);
6979
7028
  handleMenuClose();
6980
7029
  },
7030
+ disabled: visibleConversationCount === 0,
6981
7031
  sx: { color: theme.palette.error.main },
6982
7032
  children: [
6983
7033
  /* @__PURE__ */ jsx13(ListItemIcon4, { children: /* @__PURE__ */ jsx13(DeleteSweepIcon2, { fontSize: "small", sx: { color: theme.palette.error.main } }) }),
@@ -6996,7 +7046,7 @@ var EnhancedMobileConversationsModal = ({
6996
7046
  fullWidth: true,
6997
7047
  children: [
6998
7048
  /* @__PURE__ */ jsx13(DialogTitle4, { children: "Clear All Conversations?" }),
6999
- /* @__PURE__ */ jsx13(DialogContent4, { children: /* @__PURE__ */ jsx13(Typography7, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
7049
+ /* @__PURE__ */ jsx13(DialogContent4, { children: /* @__PURE__ */ jsx13(Typography7, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
7000
7050
  /* @__PURE__ */ jsxs10(DialogActions4, { children: [
7001
7051
  /* @__PURE__ */ jsx13(Button5, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
7002
7052
  /* @__PURE__ */ jsx13(
@@ -8039,7 +8089,7 @@ var UnderReview = () => {
8039
8089
  var under_review_default = UnderReview;
8040
8090
 
8041
8091
  // src/components/ConnectionStatus.tsx
8042
- import { Box as Box14, Chip as Chip3, useTheme as useTheme15 } from "@mui/material";
8092
+ import { Box as Box14, Chip as Chip4, useTheme as useTheme15 } from "@mui/material";
8043
8093
  import WifiIcon from "@mui/icons-material/Wifi";
8044
8094
  import WifiOffIcon from "@mui/icons-material/WifiOff";
8045
8095
  import SignalWifi2BarIcon from "@mui/icons-material/SignalWifi2Bar";
@@ -8103,7 +8153,7 @@ var ConnectionStatus = ({
8103
8153
  }
8104
8154
  },
8105
8155
  children: /* @__PURE__ */ jsx17(
8106
- Chip3,
8156
+ Chip4,
8107
8157
  {
8108
8158
  icon: config.icon,
8109
8159
  label: config.label,
@@ -9440,4 +9490,4 @@ var chat_default = Chat;
9440
9490
  export {
9441
9491
  chat_default
9442
9492
  };
9443
- //# sourceMappingURL=chunk-6V2YMAX2.mjs.map
9493
+ //# sourceMappingURL=chunk-ZRTP2N7E.mjs.map