@burtson-labs/bandit-engine 2.0.84 → 2.0.86

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 (34) hide show
  1. package/dist/{chat-OY5CLOBW.mjs → chat-QMGKUFBI.mjs} +6 -6
  2. package/dist/chat-provider.js.map +1 -1
  3. package/dist/chat-provider.mjs +4 -4
  4. package/dist/{chunk-YYYEMVBV.mjs → chunk-7SQLHCBV.mjs} +2 -2
  5. package/dist/{chunk-5DSDARPR.mjs → chunk-AJSGL2XJ.mjs} +3 -3
  6. package/dist/{chunk-57L7TXB6.mjs → chunk-C2L6ZSWR.mjs} +4 -4
  7. package/dist/{chunk-57L7TXB6.mjs.map → chunk-C2L6ZSWR.mjs.map} +1 -1
  8. package/dist/{chunk-RVKERD5O.mjs → chunk-FIZVBEAY.mjs} +84 -20
  9. package/dist/chunk-FIZVBEAY.mjs.map +1 -0
  10. package/dist/{chunk-6ITUH375.mjs → chunk-I4QUXTIM.mjs} +2 -2
  11. package/dist/{chunk-3QYZOCIW.mjs → chunk-OICDRDQZ.mjs} +8 -8
  12. package/dist/{chunk-OPN32F2X.mjs → chunk-TETTI3QV.mjs} +4 -4
  13. package/dist/{chunk-3LT77723.mjs → chunk-WQLKBI3Y.mjs} +2 -2
  14. package/dist/{chunk-4D7245ZO.mjs → chunk-ZLBREJKH.mjs} +16 -1
  15. package/dist/chunk-ZLBREJKH.mjs.map +1 -0
  16. package/dist/index.js +96 -17
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +9 -9
  19. package/dist/management/management.js +96 -17
  20. package/dist/management/management.js.map +1 -1
  21. package/dist/management/management.mjs +7 -7
  22. package/dist/modals/chat-modal/chat-modal.js +2 -2
  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-4D7245ZO.mjs.map +0 -1
  27. package/dist/chunk-RVKERD5O.mjs.map +0 -1
  28. /package/dist/{chat-OY5CLOBW.mjs.map → chat-QMGKUFBI.mjs.map} +0 -0
  29. /package/dist/{chunk-YYYEMVBV.mjs.map → chunk-7SQLHCBV.mjs.map} +0 -0
  30. /package/dist/{chunk-5DSDARPR.mjs.map → chunk-AJSGL2XJ.mjs.map} +0 -0
  31. /package/dist/{chunk-6ITUH375.mjs.map → chunk-I4QUXTIM.mjs.map} +0 -0
  32. /package/dist/{chunk-3QYZOCIW.mjs.map → chunk-OICDRDQZ.mjs.map} +0 -0
  33. /package/dist/{chunk-OPN32F2X.mjs.map → chunk-TETTI3QV.mjs.map} +0 -0
  34. /package/dist/{chunk-3LT77723.mjs.map → chunk-WQLKBI3Y.mjs.map} +0 -0
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-ONQMRE2G.mjs";
4
4
  import {
5
5
  StreamingMarkdown_default
6
- } from "./chunk-YYYEMVBV.mjs";
6
+ } from "./chunk-7SQLHCBV.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
- } from "./chunk-3LT77723.mjs";
9
+ } from "./chunk-WQLKBI3Y.mjs";
10
10
  import {
11
11
  AddIcon,
12
12
  ArrowDownwardIcon,
@@ -43,7 +43,7 @@ import {
43
43
  useNotificationService,
44
44
  useTTS,
45
45
  useVoiceStore
46
- } from "./chunk-57L7TXB6.mjs";
46
+ } from "./chunk-C2L6ZSWR.mjs";
47
47
  import {
48
48
  authenticationService,
49
49
  brandingService_default,
@@ -56,6 +56,7 @@ import {
56
56
  getCurrentDateTimeContext,
57
57
  getRandomTopicOfInterest,
58
58
  pickDistinctRandomTopics,
59
+ readPersistedToken,
59
60
  sanitizeConversationName,
60
61
  toTitleCase,
61
62
  useAIQueryStore,
@@ -69,7 +70,7 @@ import {
69
70
  useMemoryStore,
70
71
  useProjectStore,
71
72
  useVectorStore
72
- } from "./chunk-4D7245ZO.mjs";
73
+ } from "./chunk-ZLBREJKH.mjs";
73
74
  import {
74
75
  indexedDBService_default,
75
76
  useModelStore,
@@ -5985,6 +5986,11 @@ var ConversationDrawer = ({ open, onClose }) => {
5985
5986
  return void 0;
5986
5987
  }, [user, userDisplayName]);
5987
5988
  const [avatarImage, setAvatarImage] = useState12(BANDIT_AVATAR);
5989
+ useEffect10(() => {
5990
+ const fresh = readPersistedToken();
5991
+ const store = useAuthenticationStore.getState();
5992
+ if (fresh && fresh !== store.token) store.setToken(fresh);
5993
+ }, []);
5988
5994
  useEffect10(() => {
5989
5995
  let active2 = true;
5990
5996
  let objectUrl = null;
@@ -6738,7 +6744,7 @@ import {
6738
6744
  Avatar as Avatar7,
6739
6745
  Chip as Chip4
6740
6746
  } from "@mui/material";
6741
- import { X as CloseIcon5, X as ClearIcon2, Search as SearchIcon2, Folder as FolderIcon5, MoreVertical as MoreVertIcon4, Trash2 as DeleteSweepIcon2, Inbox as InboxIcon4, Plus as AddIcon5 } from "lucide-react";
6747
+ import { X as CloseIcon5, X as ClearIcon2, Search as SearchIcon2, Folder as FolderIcon5, MoreVertical as MoreVertIcon4, Trash2 as DeleteSweepIcon2, Inbox as InboxIcon4, Plus as AddIcon5, Settings as SettingsIcon3, Brain as MemoryIcon2 } from "lucide-react";
6742
6748
  import { useTheme as useTheme11, alpha as alpha7 } from "@mui/material/styles";
6743
6749
  import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
6744
6750
  var BANDIT_AVATAR2 = "https://cdn.burtson.ai/images/bandit-head.png";
@@ -6792,6 +6798,7 @@ var EnhancedMobileConversationsModal = ({
6792
6798
  deleteProject
6793
6799
  } = useProjectStore();
6794
6800
  const [projectManagementOpen, setProjectManagementOpen] = useState13(false);
6801
+ const [memoryModalOpen, setMemoryModalOpen] = useState13(false);
6795
6802
  const [collapsedProjects, setCollapsedProjects] = useState13(/* @__PURE__ */ new Set());
6796
6803
  const didInitCollapseRef = useRef9(false);
6797
6804
  const [searchQuery, setSearchQuery] = useState13("");
@@ -6836,21 +6843,49 @@ var EnhancedMobileConversationsModal = ({
6836
6843
  return void 0;
6837
6844
  }, [user, userDisplayName]);
6838
6845
  useEffect11(() => {
6839
- const fetchBranding = async () => {
6846
+ if (!open) return;
6847
+ const fresh = readPersistedToken();
6848
+ const authStore = useAuthenticationStore.getState();
6849
+ if (fresh && fresh !== authStore.token) authStore.setToken(fresh);
6850
+ let active2 = true;
6851
+ let objectUrl = null;
6852
+ const resolveAvatar = async () => {
6853
+ try {
6854
+ const avatarId = getCustomClaim("avatarUrl");
6855
+ const fileStorageApiUrl = usePackageSettingsStore.getState().settings?.fileStorageApiUrl;
6856
+ const token = useAuthenticationStore.getState().token;
6857
+ if (avatarId && fileStorageApiUrl && token) {
6858
+ const base = fileStorageApiUrl.replace(/\/$/, "");
6859
+ const res = await fetch(`${base}/app-asset/download/${encodeURIComponent(avatarId)}`, {
6860
+ headers: { Authorization: `Bearer ${token}` }
6861
+ });
6862
+ if (res.ok) {
6863
+ const blob = await res.blob();
6864
+ if (active2) {
6865
+ objectUrl = URL.createObjectURL(blob);
6866
+ setAvatarImage(objectUrl);
6867
+ }
6868
+ return;
6869
+ }
6870
+ }
6871
+ } catch {
6872
+ }
6840
6873
  try {
6841
6874
  const branding = await brandingService_default.getBranding();
6842
- setAvatarImage(branding?.logoBase64 || BANDIT_AVATAR2);
6875
+ if (active2) setAvatarImage(branding?.logoBase64 || BANDIT_AVATAR2);
6843
6876
  } catch (error) {
6844
6877
  debugLogger.error("Failed to load branding avatar", {
6845
6878
  error: error instanceof Error ? error.message : String(error)
6846
6879
  });
6847
- setAvatarImage(BANDIT_AVATAR2);
6880
+ if (active2) setAvatarImage(BANDIT_AVATAR2);
6848
6881
  }
6849
6882
  };
6850
- if (open) {
6851
- fetchBranding();
6852
- }
6853
- }, [open]);
6883
+ resolveAvatar();
6884
+ return () => {
6885
+ active2 = false;
6886
+ if (objectUrl) URL.revokeObjectURL(objectUrl);
6887
+ };
6888
+ }, [open, getCustomClaim]);
6854
6889
  const avatarLabel = userDisplayName || user?.email || "Bandit";
6855
6890
  const avatarInitials = useMemo3(() => deriveInitials2(avatarLabel), [avatarLabel]);
6856
6891
  const buildSnippet = (text, query, idx) => {
@@ -7094,6 +7129,15 @@ var EnhancedMobileConversationsModal = ({
7094
7129
  }
7095
7130
  }
7096
7131
  ),
7132
+ /* @__PURE__ */ jsx14(
7133
+ IconButton8,
7134
+ {
7135
+ onClick: () => setMemoryModalOpen(true),
7136
+ "aria-label": "Memory",
7137
+ sx: { color: theme.palette.text.secondary },
7138
+ children: /* @__PURE__ */ jsx14(MemoryIcon2, {})
7139
+ }
7140
+ ),
7097
7141
  /* @__PURE__ */ jsx14(
7098
7142
  IconButton8,
7099
7143
  {
@@ -7503,6 +7547,9 @@ var EnhancedMobileConversationsModal = ({
7503
7547
  /* @__PURE__ */ jsxs11(
7504
7548
  Box11,
7505
7549
  {
7550
+ onClick: user ? () => {
7551
+ window.location.href = "/profile";
7552
+ } : void 0,
7506
7553
  sx: {
7507
7554
  mt: "auto",
7508
7555
  px: 2,
@@ -7510,10 +7557,9 @@ var EnhancedMobileConversationsModal = ({
7510
7557
  borderTop: `1px solid ${alpha7(theme.palette.divider, 0.6)}`,
7511
7558
  display: "flex",
7512
7559
  alignItems: "center",
7513
- justifyContent: "center",
7514
7560
  gap: 1.25,
7515
7561
  bgcolor: alpha7(theme.palette.background.default, 0.88),
7516
- flexWrap: "wrap"
7562
+ cursor: user ? "pointer" : "default"
7517
7563
  },
7518
7564
  children: [
7519
7565
  /* @__PURE__ */ jsx14(
@@ -7531,7 +7577,7 @@ var EnhancedMobileConversationsModal = ({
7531
7577
  children: avatarInitials
7532
7578
  }
7533
7579
  ),
7534
- /* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, minWidth: 0 }, children: [
7580
+ /* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, gap: 0.25 }, children: [
7535
7581
  /* @__PURE__ */ jsx14(
7536
7582
  Typography8,
7537
7583
  {
@@ -7541,16 +7587,33 @@ var EnhancedMobileConversationsModal = ({
7541
7587
  children: user ? userDisplayName : "Not signed in"
7542
7588
  }
7543
7589
  ),
7544
- !user && /* @__PURE__ */ jsx14(
7590
+ /* @__PURE__ */ jsx14(
7545
7591
  Typography8,
7546
7592
  {
7547
7593
  variant: "caption",
7548
- sx: { color: theme.palette.text.secondary },
7549
7594
  noWrap: true,
7550
- children: "Connect your account to sync chats"
7595
+ sx: { color: theme.palette.text.secondary },
7596
+ children: user ? "View profile & settings" : "Connect your account to sync chats"
7551
7597
  }
7552
7598
  )
7553
- ] })
7599
+ ] }),
7600
+ user && /* @__PURE__ */ jsx14(
7601
+ Box11,
7602
+ {
7603
+ sx: {
7604
+ flexShrink: 0,
7605
+ display: "flex",
7606
+ alignItems: "center",
7607
+ justifyContent: "center",
7608
+ width: 30,
7609
+ height: 30,
7610
+ borderRadius: "50%",
7611
+ border: `1px solid ${alpha7(theme.palette.divider, 0.8)}`,
7612
+ color: theme.palette.text.secondary
7613
+ },
7614
+ children: /* @__PURE__ */ jsx14(SettingsIcon3, { size: 16 })
7615
+ }
7616
+ )
7554
7617
  ]
7555
7618
  }
7556
7619
  )
@@ -7566,6 +7629,7 @@ var EnhancedMobileConversationsModal = ({
7566
7629
  onClose: () => setProjectManagementOpen(false)
7567
7630
  }
7568
7631
  ),
7632
+ /* @__PURE__ */ jsx14(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
7569
7633
  conversationToMove && /* @__PURE__ */ jsx14(
7570
7634
  move_conversation_modal_default,
7571
7635
  {
@@ -10315,4 +10379,4 @@ var chat_default = Chat;
10315
10379
  export {
10316
10380
  chat_default
10317
10381
  };
10318
- //# sourceMappingURL=chunk-RVKERD5O.mjs.map
10382
+ //# sourceMappingURL=chunk-FIZVBEAY.mjs.map