@burtson-labs/bandit-engine 2.0.78 → 2.0.79

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-2IK2YJGB.mjs";
3
+ } from "./chunk-3E66ZVMB.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-OPN32F2X.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-UDSKWLDG.mjs";
13
+ } from "./chunk-XJH5E5QG.mjs";
14
14
  import "./chunk-YYYEMVBV.mjs";
15
15
  import "./chunk-6ITUH375.mjs";
16
16
  import "./chunk-3LT77723.mjs";
@@ -25740,6 +25740,7 @@ var init_conversation_drawer = __esm({
25740
25740
  init_conversationStore();
25741
25741
  init_projectStore();
25742
25742
  init_authenticationStore();
25743
+ init_packageSettingsStore();
25743
25744
  init_brandingService();
25744
25745
  init_project_management_modal();
25745
25746
  init_move_conversation_modal();
@@ -25841,19 +25842,45 @@ var init_conversation_drawer = __esm({
25841
25842
  }, [user2, userDisplayName]);
25842
25843
  const [avatarImage, setAvatarImage] = (0, import_react53.useState)(BANDIT_AVATAR);
25843
25844
  (0, import_react53.useEffect)(() => {
25844
- const fetchBranding = async () => {
25845
+ let active2 = true;
25846
+ let objectUrl = null;
25847
+ const resolveAvatar2 = async () => {
25848
+ try {
25849
+ const avatarId = getCustomClaim("avatarUrl");
25850
+ const fileStorageApiUrl = usePackageSettingsStore.getState().settings?.fileStorageApiUrl;
25851
+ const token = useAuthenticationStore.getState().token;
25852
+ if (avatarId && fileStorageApiUrl && token) {
25853
+ const base = fileStorageApiUrl.replace(/\/$/, "");
25854
+ const res = await fetch(`${base}/app-asset/download/${encodeURIComponent(avatarId)}`, {
25855
+ headers: { Authorization: `Bearer ${token}` }
25856
+ });
25857
+ if (res.ok) {
25858
+ const blob = await res.blob();
25859
+ if (active2) {
25860
+ objectUrl = URL.createObjectURL(blob);
25861
+ setAvatarImage(objectUrl);
25862
+ }
25863
+ return;
25864
+ }
25865
+ }
25866
+ } catch {
25867
+ }
25845
25868
  try {
25846
25869
  const branding = await brandingService_default.getBranding();
25847
- setAvatarImage(branding?.logoBase64 || BANDIT_AVATAR);
25870
+ if (active2) setAvatarImage(branding?.logoBase64 || BANDIT_AVATAR);
25848
25871
  } catch (error) {
25849
25872
  debugLogger.error("Failed to load branding avatar", {
25850
25873
  error: error instanceof Error ? error.message : String(error)
25851
25874
  });
25852
- setAvatarImage(BANDIT_AVATAR);
25875
+ if (active2) setAvatarImage(BANDIT_AVATAR);
25853
25876
  }
25854
25877
  };
25855
- fetchBranding();
25856
- }, []);
25878
+ resolveAvatar2();
25879
+ return () => {
25880
+ active2 = false;
25881
+ if (objectUrl) URL.revokeObjectURL(objectUrl);
25882
+ };
25883
+ }, [getCustomClaim]);
25857
25884
  const avatarLabel = userDisplayName || user2?.email || "Bandit";
25858
25885
  const avatarInitials = (0, import_react53.useMemo)(() => deriveInitials(avatarLabel), [avatarLabel]);
25859
25886
  (0, import_react53.useEffect)(() => {
@@ -26358,6 +26385,10 @@ var init_conversation_drawer = __esm({
26358
26385
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
26359
26386
  import_material42.Box,
26360
26387
  {
26388
+ onClick: user2 ? () => {
26389
+ window.location.href = "/profile";
26390
+ } : void 0,
26391
+ title: user2 ? "Profile & settings" : void 0,
26361
26392
  sx: {
26362
26393
  mt: "auto",
26363
26394
  px: 2,
@@ -26367,7 +26398,10 @@ var init_conversation_drawer = __esm({
26367
26398
  alignItems: "center",
26368
26399
  gap: 1.5,
26369
26400
  justifyContent: "center",
26370
- bgcolor: (0, import_material42.alpha)(theme.palette.background.default, isMobile ? 0.9 : 0.6)
26401
+ bgcolor: (0, import_material42.alpha)(theme.palette.background.default, isMobile ? 0.9 : 0.6),
26402
+ cursor: user2 ? "pointer" : "default",
26403
+ transition: "background-color 0.15s ease",
26404
+ "&:hover": user2 ? { bgcolor: (0, import_material42.alpha)(theme.palette.primary.main, 0.08) } : void 0
26371
26405
  },
26372
26406
  children: [
26373
26407
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(