@burtson-labs/bandit-engine 2.0.62 → 2.0.64

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.
@@ -12681,85 +12681,8 @@ var init_ai_response_action_bar = __esm({
12681
12681
  }
12682
12682
  });
12683
12683
 
12684
- // src/services/branding/brandingService.ts
12685
- var BrandingService, brandingService, brandingService_default;
12686
- var init_brandingService = __esm({
12687
- "src/services/branding/brandingService.ts"() {
12688
- "use strict";
12689
- init_indexedDBService();
12690
- init_debugLogger();
12691
- BrandingService = class {
12692
- DB_NAME = "banditConfig";
12693
- DB_VERSION = 1;
12694
- STORE_NAME = "config";
12695
- STORE_CONFIGS = [{ name: "config", keyPath: "id" }];
12696
- async getBranding() {
12697
- try {
12698
- const data = await indexedDBService_default.get(
12699
- this.DB_NAME,
12700
- this.DB_VERSION,
12701
- this.STORE_NAME,
12702
- "main",
12703
- this.STORE_CONFIGS
12704
- );
12705
- if (data?.branding && (data.branding.logoBase64 || data.branding.hasTransparentLogo !== void 0 || data.branding.brandingText)) {
12706
- return {
12707
- logoBase64: data.branding.logoBase64,
12708
- hasTransparentLogo: data.branding.hasTransparentLogo,
12709
- brandingText: data.branding.brandingText
12710
- };
12711
- }
12712
- return null;
12713
- } catch (error) {
12714
- throw error;
12715
- }
12716
- }
12717
- async setBrandingFromConfig(config) {
12718
- try {
12719
- const existing = await indexedDBService_default.get(
12720
- this.DB_NAME,
12721
- this.DB_VERSION,
12722
- this.STORE_NAME,
12723
- "main",
12724
- this.STORE_CONFIGS
12725
- ) || { id: "main" };
12726
- if (existing.branding?.userSaved) {
12727
- debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: User branding detected, blocking CDN config override");
12728
- return;
12729
- }
12730
- const hasUserBranding = existing.branding && (existing.branding.logoBase64 || existing.branding.brandingText || existing.branding.theme || existing.branding.hasTransparentLogo !== void 0);
12731
- if (hasUserBranding) {
12732
- debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: Detected user branding data, blocking CDN config override");
12733
- return;
12734
- }
12735
- debugLogger.debug("\u{1F527} BrandingService: No user branding detected, applying CDN config");
12736
- const branding = config.branding || {};
12737
- const updated = {
12738
- ...existing,
12739
- branding: {
12740
- ...existing.branding,
12741
- ...branding
12742
- }
12743
- };
12744
- await indexedDBService_default.put(
12745
- this.DB_NAME,
12746
- this.DB_VERSION,
12747
- this.STORE_NAME,
12748
- updated,
12749
- this.STORE_CONFIGS
12750
- );
12751
- } catch (error) {
12752
- throw error;
12753
- }
12754
- }
12755
- };
12756
- brandingService = new BrandingService();
12757
- brandingService_default = brandingService;
12758
- }
12759
- });
12760
-
12761
12684
  // src/modals/chat-modal/ai-response-text-field.tsx
12762
- var import_react14, import_styles2, import_react_markdown, import_remark_gfm, import_rehype_raw, import_rehype_sanitize2, import_material8, import_jsx_runtime9, brainIcon, avatarFilenames, banditHead3, resolveAvatar2, normalizeTables, isNonEmptyString, toDateSafe, toNumberArray, MarkdownCodeBlock, AIResponseTextField, ai_response_text_field_default;
12685
+ var import_react14, import_styles2, import_react_markdown, import_remark_gfm, import_rehype_raw, import_rehype_sanitize2, import_material8, import_jsx_runtime9, brainIcon, normalizeTables, isNonEmptyString, toDateSafe, toNumberArray, MarkdownCodeBlock, AIResponseTextField, ai_response_text_field_default;
12763
12686
  var init_ai_response_text_field = __esm({
12764
12687
  "src/modals/chat-modal/ai-response-text-field.tsx"() {
12765
12688
  "use strict";
@@ -12774,33 +12697,12 @@ var init_ai_response_text_field = __esm({
12774
12697
  import_rehype_sanitize2 = __toESM(require("rehype-sanitize"));
12775
12698
  init_debugLogger();
12776
12699
  import_material8 = require("@mui/material");
12777
- init_modelStore();
12778
12700
  init_lowlight();
12779
12701
  init_markdownRendering();
12780
12702
  init_lucide_icons();
12781
12703
  init_ai_response_action_bar();
12782
- init_brandingService();
12783
12704
  import_jsx_runtime9 = require("react/jsx-runtime");
12784
12705
  brainIcon = "https://cdn.burtson.ai/images/brain-icon.png";
12785
- avatarFilenames = {
12786
- "Bandit-Core": "core-avatar.png",
12787
- "Bandit-Muse": "muse-avatar.png",
12788
- "Bandit-Logic": "logic-avatar.png",
12789
- "Bandit-D1VA": "d1va-avatar.png",
12790
- "Bandit-Exec": "exec-avatar.png",
12791
- "default": "bandit-head.png"
12792
- };
12793
- banditHead3 = `https://cdn.burtson.ai/images/bandit-head.png`;
12794
- resolveAvatar2 = (selectedModel) => {
12795
- const model = useModelStore.getState().availableModels.find(
12796
- (m) => m.name === selectedModel
12797
- );
12798
- if (model?.avatarBase64) {
12799
- return model.avatarBase64;
12800
- }
12801
- const avatarFilename = avatarFilenames[selectedModel] || avatarFilenames["default"];
12802
- return `https://cdn.burtson.ai/avatars/${avatarFilename}`;
12803
- };
12804
12706
  normalizeTables = (markdown2) => {
12805
12707
  const lines = markdown2.split("\n");
12806
12708
  const output = [];
@@ -13146,15 +13048,6 @@ var init_ai_response_text_field = __esm({
13146
13048
  const timeout3 = setTimeout(() => setShowMemoryUpdated(false), 3e3);
13147
13049
  return () => clearTimeout(timeout3);
13148
13050
  }, [memoryUpdated]);
13149
- const selectedModel = useModelStore((state) => state.selectedModel);
13150
- const [userAvatar, setUserAvatar] = (0, import_react14.useState)(banditHead3);
13151
- (0, import_react14.useEffect)(() => {
13152
- const fetchBranding = async () => {
13153
- const branding = await brandingService_default.getBranding();
13154
- setUserAvatar(branding?.logoBase64 || banditHead3);
13155
- };
13156
- fetchBranding();
13157
- }, []);
13158
13051
  const theme = (0, import_styles2.useTheme)();
13159
13052
  const chatResponse = theme.palette.chat?.response;
13160
13053
  const sanitizeMarkdown = (raw) => {
@@ -13523,283 +13416,109 @@ ${sourcesMarkdownList.join("\n")}`;
13523
13416
  alignSelf: "stretch",
13524
13417
  display: "flex",
13525
13418
  flexDirection: "column",
13526
- bgcolor: chatResponse.containerBackground,
13527
- color: chatResponse.aiText || "#fff",
13528
- p: isMobile ? 1 : 2,
13529
- borderRadius: "4px",
13530
- userSelect: "text",
13531
- border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
13532
- boxShadow: "0 0 6px rgba(0,0,0,0.3)"
13419
+ color: chatResponse.aiText || theme.palette.text.primary,
13420
+ px: isMobile ? 0.5 : 2,
13421
+ py: 1,
13422
+ userSelect: "text"
13533
13423
  },
13534
13424
  children: [
13535
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13536
- import_material8.Box,
13537
- {
13538
- sx: {
13539
- display: "flex",
13540
- flexDirection: "column",
13541
- alignItems: {
13542
- xs: "flex-start",
13543
- sm: "flex-end"
13425
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", justifyContent: "flex-end", mb: 2.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { maxWidth: { xs: "100%", sm: "85%" }, minWidth: 0 }, children: [
13426
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13427
+ import_material8.Box,
13428
+ {
13429
+ sx: {
13430
+ bgcolor: chatResponse.userBubble || (0, import_styles2.alpha)(theme.palette.common.white, 0.07),
13431
+ borderRadius: "18px",
13432
+ px: 2,
13433
+ py: 1.25,
13434
+ wordBreak: "break-word",
13435
+ whiteSpace: "pre-wrap",
13436
+ overflowWrap: "break-word"
13544
13437
  },
13545
- gap: 2,
13546
- mb: 2,
13547
- justifyContent: "flex-end"
13548
- },
13549
- children: [
13550
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13551
- import_material8.Box,
13438
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13439
+ import_material8.Typography,
13552
13440
  {
13553
13441
  sx: {
13554
- display: "flex",
13555
- flexDirection: "column",
13556
- alignItems: "center"
13442
+ color: theme.palette.text.primary,
13443
+ lineHeight: 1.5,
13444
+ wordBreak: "break-word",
13445
+ whiteSpace: "pre-wrap"
13557
13446
  },
13558
- children: [
13559
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13560
- import_material8.Avatar,
13561
- {
13562
- alt: "You",
13563
- src: userAvatar,
13564
- sx: {
13565
- display: { xs: "none", sm: "flex" },
13566
- width: { sm: 72 },
13567
- height: { sm: 72 },
13568
- bgcolor: chatResponse.userAvatarBackground || (theme.palette.mode === "dark" ? "transparent" : "#eee"),
13569
- color: "#fff",
13570
- fontWeight: "bold",
13571
- fontSize: { sm: "1.1rem" },
13572
- border: "2px solid #a78bfa",
13573
- boxShadow: "0 0 8px rgba(167, 139, 250, 0.3)",
13574
- transform: "scaleX(1)"
13575
- }
13576
- }
13577
- ),
13578
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13579
- import_material8.Typography,
13580
- {
13581
- variant: "caption",
13582
- sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
13583
- children: "You said"
13584
- }
13585
- )
13586
- ]
13447
+ children: question
13587
13448
  }
13588
- ),
13589
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { flex: 1 }, children: [
13590
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13591
- import_material8.Box,
13592
- {
13593
- sx: {
13594
- display: "inline-block",
13595
- textAlign: "left",
13596
- bgcolor: chatResponse.userBubble || "#1f1f1f",
13597
- borderRadius: "4px",
13598
- px: isMobile ? 1 : 2,
13599
- py: 1.5,
13600
- width: isMobile ? "100%" : "fit-content",
13601
- maxWidth: "100%",
13602
- border: "1px solid " + (chatResponse.aiBorder || "#444"),
13603
- wordBreak: "break-word",
13604
- whiteSpace: "pre-wrap",
13605
- overflowWrap: "break-word",
13606
- mt: { xs: 0.5, sm: 0.25 }
13607
- },
13608
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13609
- import_material8.Typography,
13610
- {
13611
- sx: {
13612
- color: chatResponse.userText || "#6C9AC5",
13613
- fontStyle: "italic",
13614
- wordBreak: "break-word",
13615
- whiteSpace: "pre-wrap"
13616
- },
13617
- children: question
13618
- }
13619
- )
13620
- }
13621
- ),
13622
- images && images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap" }, children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13623
- import_material8.Avatar,
13624
- {
13625
- src: img,
13626
- variant: "rounded",
13627
- onClick: () => setOpenImage(img),
13628
- sx: {
13629
- width: 64,
13630
- height: 64,
13631
- borderRadius: 2,
13632
- cursor: "pointer",
13633
- "&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
13634
- }
13635
- },
13636
- i
13637
- )) })
13638
- ] })
13639
- ]
13640
- }
13641
- ),
13642
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { borderBottom: `1px solid ${theme.palette.divider}`, my: 2 } }),
13643
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13644
- import_material8.Box,
13645
- {
13646
- sx: {
13647
- display: "flex",
13648
- flexDirection: "column",
13649
- alignItems: {
13650
- xs: "center",
13651
- sm: "flex-start"
13652
- },
13653
- gap: 2,
13654
- mb: 2
13449
+ )
13450
+ }
13451
+ ),
13452
+ images && images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap", justifyContent: "flex-end" }, children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13453
+ import_material8.Avatar,
13454
+ {
13455
+ src: img,
13456
+ variant: "rounded",
13457
+ onClick: () => setOpenImage(img),
13458
+ sx: {
13459
+ width: 96,
13460
+ height: 96,
13461
+ borderRadius: 2,
13462
+ border: `1px solid ${(0, import_styles2.alpha)(theme.palette.text.primary, 0.25)}`,
13463
+ cursor: "pointer",
13464
+ "&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
13465
+ }
13655
13466
  },
13656
- children: [
13657
- typeof response === "string" && response.trim() !== "" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13658
- import_material8.Box,
13659
- {
13660
- sx: {
13661
- display: "flex",
13662
- flexDirection: "column",
13663
- alignItems: "center",
13664
- mr: 2,
13665
- position: "relative"
13666
- },
13667
- children: [
13668
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13669
- import_material8.Avatar,
13670
- {
13671
- src: resolveAvatar2(selectedModel),
13672
- alt: selectedModel,
13673
- sx: {
13674
- display: { xs: "none", sm: "flex" },
13675
- width: 72,
13676
- height: 72,
13677
- border: "1px solid #888",
13678
- boxShadow: "0 0 6px rgba(136, 136, 136, 0.4)",
13679
- filter: "brightness(1.6)"
13680
- }
13681
- }
13682
- ),
13683
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: { xs: "none", sm: "block" } }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13684
- import_material8.Typography,
13685
- {
13686
- variant: "caption",
13687
- sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
13688
- children: [
13689
- selectedModel,
13690
- " says"
13691
- ]
13692
- }
13693
- ) })
13694
- ]
13695
- }
13696
- ),
13697
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13698
- import_material8.Box,
13699
- {
13700
- sx: {
13701
- display: { xs: "flex", sm: "none" },
13702
- justifyContent: "right",
13703
- width: "100%",
13704
- mt: -1,
13705
- mb: 1
13706
- },
13707
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13708
- import_material8.Typography,
13709
- {
13710
- variant: "caption",
13711
- sx: { fontStyle: "italic", color: chatResponse.modelLabel || "#888" },
13712
- children: [
13713
- selectedModel,
13714
- " says"
13715
- ]
13716
- }
13717
- )
13718
- }
13719
- ),
13720
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { position: "relative", width: "100%" }, children: [
13721
- cancelled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13722
- import_material8.Box,
13723
- {
13724
- sx: {
13725
- position: "absolute",
13726
- top: -24,
13727
- left: 0,
13728
- display: "flex",
13729
- alignItems: "center",
13730
- gap: 1,
13731
- pl: 1,
13732
- zIndex: 1
13733
- },
13734
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
13735
- }
13736
- ),
13737
- showMemoryUpdated && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13738
- import_material8.Box,
13739
- {
13740
- sx: {
13741
- position: "absolute",
13742
- top: -24,
13743
- right: 0,
13744
- display: "flex",
13745
- alignItems: "center",
13746
- gap: 1,
13747
- pr: 1,
13748
- animation: "fadeOut 0.3s ease-in 2.7s forwards",
13749
- zIndex: 1
13750
- },
13751
- children: [
13752
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13753
- "img",
13754
- {
13755
- src: brainIcon,
13756
- alt: "Memory",
13757
- style: { width: 18, height: 18 }
13758
- }
13759
- ),
13760
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13761
- import_material8.Typography,
13762
- {
13763
- variant: "caption",
13764
- sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
13765
- children: "Bandit added to memory"
13766
- }
13767
- )
13768
- ]
13769
- }
13770
- ),
13467
+ i
13468
+ )) })
13469
+ ] }) }),
13470
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { position: "relative", width: "100%", maxWidth: { xs: "100%", sm: "768px" } }, children: [
13471
+ cancelled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13472
+ import_material8.Box,
13473
+ {
13474
+ sx: {
13475
+ position: "absolute",
13476
+ top: -22,
13477
+ left: 0,
13478
+ display: "flex",
13479
+ alignItems: "center",
13480
+ gap: 1,
13481
+ zIndex: 1
13482
+ },
13483
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
13484
+ }
13485
+ ),
13486
+ showMemoryUpdated && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
13487
+ import_material8.Box,
13488
+ {
13489
+ sx: {
13490
+ position: "absolute",
13491
+ top: -22,
13492
+ right: 0,
13493
+ display: "flex",
13494
+ alignItems: "center",
13495
+ gap: 1,
13496
+ animation: "fadeOut 0.3s ease-in 2.7s forwards",
13497
+ zIndex: 1
13498
+ },
13499
+ children: [
13500
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: brainIcon, alt: "Memory", style: { width: 16, height: 16 } }),
13771
13501
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13772
- import_material8.Box,
13502
+ import_material8.Typography,
13773
13503
  {
13774
- sx: {
13775
- bgcolor: chatResponse.aiBubble ?? "#2f2f2f",
13776
- borderRadius: "4px",
13777
- px: isMobile ? 1 : 1.5,
13778
- // Reduced padding on mobile
13779
- py: 1.25,
13780
- width: "100%",
13781
- maxWidth: isMobile ? "100%" : "768px",
13782
- // Full width on mobile
13783
- border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
13784
- wordBreak: "break-word",
13785
- alignSelf: "flex-start",
13786
- mt: { xs: 0.5, sm: 0.25 }
13787
- },
13788
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13789
- import_react_markdown.default,
13790
- {
13791
- remarkPlugins: [import_remark_gfm.default],
13792
- rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize2.default, markdownSanitizeSchema]],
13793
- components,
13794
- children: enrichedMarkdown ?? sanitizeMarkdown(response)
13795
- }
13796
- ) : import_react14.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
13504
+ variant: "caption",
13505
+ sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
13506
+ children: "Bandit added to memory"
13797
13507
  }
13798
13508
  )
13799
- ] })
13800
- ]
13801
- }
13802
- ),
13509
+ ]
13510
+ }
13511
+ ),
13512
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13513
+ import_react_markdown.default,
13514
+ {
13515
+ remarkPlugins: [import_remark_gfm.default],
13516
+ rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize2.default, markdownSanitizeSchema]],
13517
+ components,
13518
+ children: enrichedMarkdown ?? sanitizeMarkdown(response)
13519
+ }
13520
+ ) : import_react14.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
13521
+ ] }),
13803
13522
  !!(responseText || typeof response === "string" && response) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ai_response_action_bar_default, { text: responseText || response }),
13804
13523
  displaySourceFiles && displaySourceFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { mt: 1.5, display: "flex", gap: 2, flexWrap: "wrap", justifyContent: "flex-start" }, children: displaySourceFiles.map((doc, idx) => {
13805
13524
  debugLogger.debug("Rendering DocumentCard in AI response", {
@@ -16821,6 +16540,83 @@ var init_useNotificationService = __esm({
16821
16540
  }
16822
16541
  });
16823
16542
 
16543
+ // src/services/branding/brandingService.ts
16544
+ var BrandingService, brandingService, brandingService_default;
16545
+ var init_brandingService = __esm({
16546
+ "src/services/branding/brandingService.ts"() {
16547
+ "use strict";
16548
+ init_indexedDBService();
16549
+ init_debugLogger();
16550
+ BrandingService = class {
16551
+ DB_NAME = "banditConfig";
16552
+ DB_VERSION = 1;
16553
+ STORE_NAME = "config";
16554
+ STORE_CONFIGS = [{ name: "config", keyPath: "id" }];
16555
+ async getBranding() {
16556
+ try {
16557
+ const data = await indexedDBService_default.get(
16558
+ this.DB_NAME,
16559
+ this.DB_VERSION,
16560
+ this.STORE_NAME,
16561
+ "main",
16562
+ this.STORE_CONFIGS
16563
+ );
16564
+ if (data?.branding && (data.branding.logoBase64 || data.branding.hasTransparentLogo !== void 0 || data.branding.brandingText)) {
16565
+ return {
16566
+ logoBase64: data.branding.logoBase64,
16567
+ hasTransparentLogo: data.branding.hasTransparentLogo,
16568
+ brandingText: data.branding.brandingText
16569
+ };
16570
+ }
16571
+ return null;
16572
+ } catch (error) {
16573
+ throw error;
16574
+ }
16575
+ }
16576
+ async setBrandingFromConfig(config) {
16577
+ try {
16578
+ const existing = await indexedDBService_default.get(
16579
+ this.DB_NAME,
16580
+ this.DB_VERSION,
16581
+ this.STORE_NAME,
16582
+ "main",
16583
+ this.STORE_CONFIGS
16584
+ ) || { id: "main" };
16585
+ if (existing.branding?.userSaved) {
16586
+ debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: User branding detected, blocking CDN config override");
16587
+ return;
16588
+ }
16589
+ const hasUserBranding = existing.branding && (existing.branding.logoBase64 || existing.branding.brandingText || existing.branding.theme || existing.branding.hasTransparentLogo !== void 0);
16590
+ if (hasUserBranding) {
16591
+ debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: Detected user branding data, blocking CDN config override");
16592
+ return;
16593
+ }
16594
+ debugLogger.debug("\u{1F527} BrandingService: No user branding detected, applying CDN config");
16595
+ const branding = config.branding || {};
16596
+ const updated = {
16597
+ ...existing,
16598
+ branding: {
16599
+ ...existing.branding,
16600
+ ...branding
16601
+ }
16602
+ };
16603
+ await indexedDBService_default.put(
16604
+ this.DB_NAME,
16605
+ this.DB_VERSION,
16606
+ this.STORE_NAME,
16607
+ updated,
16608
+ this.STORE_CONFIGS
16609
+ );
16610
+ } catch (error) {
16611
+ throw error;
16612
+ }
16613
+ }
16614
+ };
16615
+ brandingService = new BrandingService();
16616
+ brandingService_default = brandingService;
16617
+ }
16618
+ });
16619
+
16824
16620
  // src/theme/banditTheme.ts
16825
16621
  var import_styles5, commonOptions, banditDarkTheme, banditLightTheme;
16826
16622
  var init_banditTheme = __esm({
@@ -27075,7 +26871,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27075
26871
  });
27076
26872
 
27077
26873
  // src/chat/chat-app-bar.tsx
27078
- var import_material42, import_react53, import_material43, import_react_router_dom2, import_shallow2, import_jsx_runtime42, CDN_BASE2, banditHead5, modelAvatars3, ChatAppBar, chat_app_bar_default;
26874
+ var import_material42, import_react53, import_material43, import_react_router_dom2, import_shallow2, import_jsx_runtime42, CDN_BASE2, banditHead4, modelAvatars3, ChatAppBar, chat_app_bar_default;
27079
26875
  var init_chat_app_bar = __esm({
27080
26876
  "src/chat/chat-app-bar.tsx"() {
27081
26877
  "use strict";
@@ -27099,7 +26895,7 @@ var init_chat_app_bar = __esm({
27099
26895
  import_shallow2 = require("zustand/shallow");
27100
26896
  import_jsx_runtime42 = require("react/jsx-runtime");
27101
26897
  CDN_BASE2 = "https://cdn.burtson.ai/";
27102
- banditHead5 = `${CDN_BASE2}/images/bandit-head.png`;
26898
+ banditHead4 = `${CDN_BASE2}/images/bandit-head.png`;
27103
26899
  modelAvatars3 = {
27104
26900
  "Bandit-Core": `${CDN_BASE2}/avatars/core-avatar.png`,
27105
26901
  "Bandit-Muse": `${CDN_BASE2}/avatars/muse-avatar.png`,
@@ -27265,7 +27061,7 @@ var init_chat_app_bar = __esm({
27265
27061
  };
27266
27062
  const selectedModel = useModelStore((s) => s.selectedModel);
27267
27063
  const currentModel = useModelStore((s) => s.availableModels.find((m) => m.name === selectedModel));
27268
- const currentAvatar = currentModel?.avatarBase64 || modelAvatars3[selectedModel] || banditHead5;
27064
+ const currentAvatar = currentModel?.avatarBase64 || modelAvatars3[selectedModel] || banditHead4;
27269
27065
  const engines = useEngineStore((s) => s.engines);
27270
27066
  const selectedEngine = useEngineStore((s) => s.selectedEngine);
27271
27067
  const effectiveEngineId = selectedEngine || usePackageSettingsStore.getState().settings?.defaultModel || "bandit-core";
@@ -27276,7 +27072,7 @@ var init_chat_app_bar = __esm({
27276
27072
  (0, import_react53.useEffect)(() => {
27277
27073
  useEngineStore.getState().fetchEngines();
27278
27074
  }, []);
27279
- const pendingModelAvatar = useModelStore.getState().availableModels.find((m) => m.name === pendingModel)?.avatarBase64 || modelAvatars3[pendingModel || ""] || banditHead5;
27075
+ const pendingModelAvatar = useModelStore.getState().availableModels.find((m) => m.name === pendingModel)?.avatarBase64 || modelAvatars3[pendingModel || ""] || banditHead4;
27280
27076
  const resolvedHomeUrl = preferences.homeUrl?.trim() || packageSettings?.homeUrl?.trim() || "";
27281
27077
  const homeTooltip = (() => {
27282
27078
  if (!resolvedHomeUrl) return "Home";
@@ -27594,7 +27390,7 @@ var init_chat_app_bar = __esm({
27594
27390
  onClick: (e) => setEngineAnchorEl(e.currentTarget),
27595
27391
  sx: pillButtonStyles,
27596
27392
  "aria-label": `Change base model (engine). Currently ${engineDisplay}`,
27597
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PsychologyIcon, { fontSize: "small" })
27393
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(AutoAwesomeIcon, { fontSize: "small" })
27598
27394
  }
27599
27395
  ) }),
27600
27396
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
@@ -27749,7 +27545,7 @@ var init_chat_app_bar = __esm({
27749
27545
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
27750
27546
  import_material42.Avatar,
27751
27547
  {
27752
- src: model.avatarBase64 || modelAvatars3[model.name] || banditHead5,
27548
+ src: model.avatarBase64 || modelAvatars3[model.name] || banditHead4,
27753
27549
  alt: model.name,
27754
27550
  sx: {
27755
27551
  width: 28,
@@ -31977,7 +31773,7 @@ init_lucide_icons();
31977
31773
  var import_jsx_runtime16 = require("react/jsx-runtime");
31978
31774
  var FULL_SCREEN_THRESHOLD = 100;
31979
31775
  var CDN_BASE = "https://cdn.burtson.ai/";
31980
- var banditHead4 = `${CDN_BASE}/images/bandit-head.png`;
31776
+ var banditHead3 = `${CDN_BASE}/images/bandit-head.png`;
31981
31777
  var modelAvatars2 = {
31982
31778
  "Bandit-Core": `${CDN_BASE}/avatars/core-avatar.png`,
31983
31779
  "Bandit-Muse": `${CDN_BASE}/avatars/muse-avatar.png`,
@@ -32067,7 +31863,7 @@ var ChatModal = ({
32067
31863
  const provider = useAIProviderStore((state) => state.provider);
32068
31864
  const notificationService2 = useNotificationService();
32069
31865
  const currentModel = availableModels.find((m) => m.name === selectedModel);
32070
- const currentAvatar = currentModel?.avatarBase64 || modelAvatars2[selectedModel] || banditHead4;
31866
+ const currentAvatar = currentModel?.avatarBase64 || modelAvatars2[selectedModel] || banditHead3;
32071
31867
  const removeImage = (index) => {
32072
31868
  setPastedImages((prev) => prev.filter((_, i) => i !== index));
32073
31869
  };
@@ -32387,7 +32183,7 @@ var ChatModal = ({
32387
32183
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
32388
32184
  import_material17.Avatar,
32389
32185
  {
32390
- src: model.avatarBase64 || modelAvatars2[model.name] || banditHead4,
32186
+ src: model.avatarBase64 || modelAvatars2[model.name] || banditHead3,
32391
32187
  alt: model.name,
32392
32188
  sx: {
32393
32189
  width: 28,
@@ -42102,7 +41898,7 @@ var Management = () => {
42102
41898
  const isMobile = (0, import_useMediaQuery2.default)("(max-width:900px)");
42103
41899
  const [sidebarOpen, setSidebarOpen] = (0, import_react57.useState)(false);
42104
41900
  const getOptimalFabLogo = async () => {
42105
- const banditHead7 = "https://cdn.burtson.ai/images/bandit-head.png";
41901
+ const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
42106
41902
  try {
42107
41903
  const subdomain = window.location.hostname.split(".")[0];
42108
41904
  const faviconUrl = `https://cdn.burtson.ai/favicons/${subdomain}/favicon.png`;
@@ -42119,10 +41915,10 @@ var Management = () => {
42119
41915
  if (branding?.logoBase64) {
42120
41916
  return branding.logoBase64;
42121
41917
  }
42122
- return banditHead7;
41918
+ return banditHead6;
42123
41919
  } catch (error) {
42124
41920
  debugLogger.error("Failed to get optimal FAB logo", { error });
42125
- return banditHead7;
41921
+ return banditHead6;
42126
41922
  }
42127
41923
  };
42128
41924
  const {
@@ -42141,8 +41937,8 @@ var Management = () => {
42141
41937
  setHasTransparentLogo
42142
41938
  } = useModelStore();
42143
41939
  const [modalOpen, setModalOpen] = (0, import_react57.useState)(false);
42144
- const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
42145
- const [fabLogo, setFabLogo] = (0, import_react57.useState)(banditHead6);
41940
+ const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
41941
+ const [fabLogo, setFabLogo] = (0, import_react57.useState)(banditHead5);
42146
41942
  const [tabIndex, setTabIndex] = (0, import_react57.useState)(4);
42147
41943
  const [logoFile, setLogoFile] = (0, import_react57.useState)(null);
42148
41944
  const [logoBase64, setLogoBase64] = (0, import_react57.useState)(null);