@burtson-labs/bandit-engine 2.0.85 → 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.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-B2HUBOJ6.mjs";
3
+ } from "./chunk-FIZVBEAY.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-TETTI3QV.mjs";
@@ -10,8 +10,8 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-R64BOUIU.mjs";
14
- import "./chunk-OHDMP7FI.mjs";
13
+ } from "./chunk-OICDRDQZ.mjs";
14
+ import "./chunk-7SQLHCBV.mjs";
15
15
  import "./chunk-I4QUXTIM.mjs";
16
16
  import "./chunk-WQLKBI3Y.mjs";
17
17
  import {
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-IXIM7BNO.mjs";
20
20
  import {
21
21
  chat_modal_default
22
- } from "./chunk-XHPSNERM.mjs";
22
+ } from "./chunk-AJSGL2XJ.mjs";
23
23
  import {
24
24
  FeedbackButton,
25
25
  FeedbackModal,
@@ -37,7 +37,7 @@ import {
37
37
  useTTS,
38
38
  useVoiceStore,
39
39
  voiceService
40
- } from "./chunk-GNTQR7L6.mjs";
40
+ } from "./chunk-C2L6ZSWR.mjs";
41
41
  import {
42
42
  DEFAULT_TIER_FEATURES,
43
43
  FeatureFlagContext,
@@ -14376,7 +14376,7 @@ var init_memory_modal = __esm({
14376
14376
  fontSize: "0.8rem",
14377
14377
  fontWeight: 500,
14378
14378
  zIndex: 1
14379
- }, children: "Advanced Vector Memory Active \u2022 Memories synced to AI database for enhanced semantic search" })
14379
+ }, children: "Cloud memory \xB7 synced to your account" })
14380
14380
  ] }),
14381
14381
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material9.Box, { sx: { flexShrink: 0 }, children: [
14382
14382
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { px: isMobileView ? 1.5 : 2, py: isMobileView ? 1.25 : 1.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -14384,7 +14384,7 @@ var init_memory_modal = __esm({
14384
14384
  {
14385
14385
  variant: "body2",
14386
14386
  sx: { color: theme.palette.text.secondary, fontSize: "0.85rem", textAlign: isMobileView ? "left" : "center" },
14387
- children: shouldUseVectorForMemories ? "Semantic memory \u2014 searches meaning across your conversations." : "Private and local. You decide what's remembered."
14387
+ children: shouldUseVectorForMemories ? "Synced to your account for quick recall." : "Private and local. You decide what's remembered."
14388
14388
  }
14389
14389
  ) }),
14390
14390
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
@@ -26736,6 +26736,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
26736
26736
  init_conversationStore();
26737
26737
  init_projectStore();
26738
26738
  init_authenticationStore();
26739
+ init_packageSettingsStore();
26740
+ init_memory_modal();
26739
26741
  init_brandingService();
26740
26742
  init_project_management_modal();
26741
26743
  init_move_conversation_modal();
@@ -26794,6 +26796,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
26794
26796
  deleteProject
26795
26797
  } = useProjectStore();
26796
26798
  const [projectManagementOpen, setProjectManagementOpen] = (0, import_react55.useState)(false);
26799
+ const [memoryModalOpen, setMemoryModalOpen] = (0, import_react55.useState)(false);
26797
26800
  const [collapsedProjects, setCollapsedProjects] = (0, import_react55.useState)(/* @__PURE__ */ new Set());
26798
26801
  const didInitCollapseRef = (0, import_react55.useRef)(false);
26799
26802
  const [searchQuery, setSearchQuery] = (0, import_react55.useState)("");
@@ -26838,21 +26841,49 @@ var init_enhanced_mobile_conversations_modal = __esm({
26838
26841
  return void 0;
26839
26842
  }, [user2, userDisplayName]);
26840
26843
  (0, import_react55.useEffect)(() => {
26841
- const fetchBranding = async () => {
26844
+ if (!open) return;
26845
+ const fresh = readPersistedToken();
26846
+ const authStore = useAuthenticationStore.getState();
26847
+ if (fresh && fresh !== authStore.token) authStore.setToken(fresh);
26848
+ let active2 = true;
26849
+ let objectUrl = null;
26850
+ const resolveAvatar2 = async () => {
26851
+ try {
26852
+ const avatarId = getCustomClaim("avatarUrl");
26853
+ const fileStorageApiUrl = usePackageSettingsStore.getState().settings?.fileStorageApiUrl;
26854
+ const token = useAuthenticationStore.getState().token;
26855
+ if (avatarId && fileStorageApiUrl && token) {
26856
+ const base = fileStorageApiUrl.replace(/\/$/, "");
26857
+ const res = await fetch(`${base}/app-asset/download/${encodeURIComponent(avatarId)}`, {
26858
+ headers: { Authorization: `Bearer ${token}` }
26859
+ });
26860
+ if (res.ok) {
26861
+ const blob = await res.blob();
26862
+ if (active2) {
26863
+ objectUrl = URL.createObjectURL(blob);
26864
+ setAvatarImage(objectUrl);
26865
+ }
26866
+ return;
26867
+ }
26868
+ }
26869
+ } catch {
26870
+ }
26842
26871
  try {
26843
26872
  const branding = await brandingService_default.getBranding();
26844
- setAvatarImage(branding?.logoBase64 || BANDIT_AVATAR2);
26873
+ if (active2) setAvatarImage(branding?.logoBase64 || BANDIT_AVATAR2);
26845
26874
  } catch (error) {
26846
26875
  debugLogger.error("Failed to load branding avatar", {
26847
26876
  error: error instanceof Error ? error.message : String(error)
26848
26877
  });
26849
- setAvatarImage(BANDIT_AVATAR2);
26878
+ if (active2) setAvatarImage(BANDIT_AVATAR2);
26850
26879
  }
26851
26880
  };
26852
- if (open) {
26853
- fetchBranding();
26854
- }
26855
- }, [open]);
26881
+ resolveAvatar2();
26882
+ return () => {
26883
+ active2 = false;
26884
+ if (objectUrl) URL.revokeObjectURL(objectUrl);
26885
+ };
26886
+ }, [open, getCustomClaim]);
26856
26887
  const avatarLabel = userDisplayName || user2?.email || "Bandit";
26857
26888
  const avatarInitials = (0, import_react55.useMemo)(() => deriveInitials2(avatarLabel), [avatarLabel]);
26858
26889
  const buildSnippet = (text, query, idx) => {
@@ -27096,6 +27127,15 @@ var init_enhanced_mobile_conversations_modal = __esm({
27096
27127
  }
27097
27128
  }
27098
27129
  ),
27130
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27131
+ import_material44.IconButton,
27132
+ {
27133
+ onClick: () => setMemoryModalOpen(true),
27134
+ "aria-label": "Memory",
27135
+ sx: { color: theme.palette.text.secondary },
27136
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Brain, {})
27137
+ }
27138
+ ),
27099
27139
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27100
27140
  import_material44.IconButton,
27101
27141
  {
@@ -27505,6 +27545,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
27505
27545
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
27506
27546
  import_material44.Box,
27507
27547
  {
27548
+ onClick: user2 ? () => {
27549
+ window.location.href = "/profile";
27550
+ } : void 0,
27508
27551
  sx: {
27509
27552
  mt: "auto",
27510
27553
  px: 2,
@@ -27512,10 +27555,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
27512
27555
  borderTop: `1px solid ${(0, import_styles29.alpha)(theme.palette.divider, 0.6)}`,
27513
27556
  display: "flex",
27514
27557
  alignItems: "center",
27515
- justifyContent: "center",
27516
27558
  gap: 1.25,
27517
27559
  bgcolor: (0, import_styles29.alpha)(theme.palette.background.default, 0.88),
27518
- flexWrap: "wrap"
27560
+ cursor: user2 ? "pointer" : "default"
27519
27561
  },
27520
27562
  children: [
27521
27563
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
@@ -27533,7 +27575,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27533
27575
  children: avatarInitials
27534
27576
  }
27535
27577
  ),
27536
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, minWidth: 0 }, children: [
27578
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, gap: 0.25 }, children: [
27537
27579
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27538
27580
  import_material44.Typography,
27539
27581
  {
@@ -27543,16 +27585,33 @@ var init_enhanced_mobile_conversations_modal = __esm({
27543
27585
  children: user2 ? userDisplayName : "Not signed in"
27544
27586
  }
27545
27587
  ),
27546
- !user2 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27588
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27547
27589
  import_material44.Typography,
27548
27590
  {
27549
27591
  variant: "caption",
27550
- sx: { color: theme.palette.text.secondary },
27551
27592
  noWrap: true,
27552
- children: "Connect your account to sync chats"
27593
+ sx: { color: theme.palette.text.secondary },
27594
+ children: user2 ? "View profile & settings" : "Connect your account to sync chats"
27553
27595
  }
27554
27596
  )
27555
- ] })
27597
+ ] }),
27598
+ user2 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27599
+ import_material44.Box,
27600
+ {
27601
+ sx: {
27602
+ flexShrink: 0,
27603
+ display: "flex",
27604
+ alignItems: "center",
27605
+ justifyContent: "center",
27606
+ width: 30,
27607
+ height: 30,
27608
+ borderRadius: "50%",
27609
+ border: `1px solid ${(0, import_styles29.alpha)(theme.palette.divider, 0.8)}`,
27610
+ color: theme.palette.text.secondary
27611
+ },
27612
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Settings, { size: 16 })
27613
+ }
27614
+ )
27556
27615
  ]
27557
27616
  }
27558
27617
  )
@@ -27568,6 +27627,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27568
27627
  onClose: () => setProjectManagementOpen(false)
27569
27628
  }
27570
27629
  ),
27630
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
27571
27631
  conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27572
27632
  move_conversation_modal_default,
27573
27633
  {