@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.
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  authenticationService,
3
- brandingService_default,
4
3
  notificationService,
5
4
  useConversationStore,
6
5
  useConversationSyncStore,
@@ -2703,25 +2702,6 @@ var ai_response_action_bar_default = AiResponseActionsBar;
2703
2702
  // src/modals/chat-modal/ai-response-text-field.tsx
2704
2703
  import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
2705
2704
  var brainIcon = "https://cdn.burtson.ai/images/brain-icon.png";
2706
- var avatarFilenames = {
2707
- "Bandit-Core": "core-avatar.png",
2708
- "Bandit-Muse": "muse-avatar.png",
2709
- "Bandit-Logic": "logic-avatar.png",
2710
- "Bandit-D1VA": "d1va-avatar.png",
2711
- "Bandit-Exec": "exec-avatar.png",
2712
- "default": "bandit-head.png"
2713
- };
2714
- var banditHead = `https://cdn.burtson.ai/images/bandit-head.png`;
2715
- var resolveAvatar = (selectedModel) => {
2716
- const model = useModelStore.getState().availableModels.find(
2717
- (m) => m.name === selectedModel
2718
- );
2719
- if (model?.avatarBase64) {
2720
- return model.avatarBase64;
2721
- }
2722
- const avatarFilename = avatarFilenames[selectedModel] || avatarFilenames["default"];
2723
- return `https://cdn.burtson.ai/avatars/${avatarFilename}`;
2724
- };
2725
2705
  var normalizeTables = (markdown2) => {
2726
2706
  const lines = markdown2.split("\n");
2727
2707
  const output = [];
@@ -3067,15 +3047,6 @@ var AIResponseTextField = ({
3067
3047
  const timeout = setTimeout(() => setShowMemoryUpdated(false), 3e3);
3068
3048
  return () => clearTimeout(timeout);
3069
3049
  }, [memoryUpdated]);
3070
- const selectedModel = useModelStore((state) => state.selectedModel);
3071
- const [userAvatar, setUserAvatar] = useState5(banditHead);
3072
- useEffect5(() => {
3073
- const fetchBranding = async () => {
3074
- const branding = await brandingService_default.getBranding();
3075
- setUserAvatar(branding?.logoBase64 || banditHead);
3076
- };
3077
- fetchBranding();
3078
- }, []);
3079
3050
  const theme = useTheme3();
3080
3051
  const chatResponse = theme.palette.chat?.response;
3081
3052
  const sanitizeMarkdown = (raw) => {
@@ -3444,283 +3415,109 @@ ${sourcesMarkdownList.join("\n")}`;
3444
3415
  alignSelf: "stretch",
3445
3416
  display: "flex",
3446
3417
  flexDirection: "column",
3447
- bgcolor: chatResponse.containerBackground,
3448
- color: chatResponse.aiText || "#fff",
3449
- p: isMobile ? 1 : 2,
3450
- borderRadius: "4px",
3451
- userSelect: "text",
3452
- border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
3453
- boxShadow: "0 0 6px rgba(0,0,0,0.3)"
3418
+ color: chatResponse.aiText || theme.palette.text.primary,
3419
+ px: isMobile ? 0.5 : 2,
3420
+ py: 1,
3421
+ userSelect: "text"
3454
3422
  },
3455
3423
  children: [
3456
- /* @__PURE__ */ jsxs4(
3457
- Box5,
3458
- {
3459
- sx: {
3460
- display: "flex",
3461
- flexDirection: "column",
3462
- alignItems: {
3463
- xs: "flex-start",
3464
- sm: "flex-end"
3424
+ /* @__PURE__ */ jsx5(Box5, { sx: { display: "flex", justifyContent: "flex-end", mb: 2.5 }, children: /* @__PURE__ */ jsxs4(Box5, { sx: { maxWidth: { xs: "100%", sm: "85%" }, minWidth: 0 }, children: [
3425
+ /* @__PURE__ */ jsx5(
3426
+ Box5,
3427
+ {
3428
+ sx: {
3429
+ bgcolor: chatResponse.userBubble || alpha(theme.palette.common.white, 0.07),
3430
+ borderRadius: "18px",
3431
+ px: 2,
3432
+ py: 1.25,
3433
+ wordBreak: "break-word",
3434
+ whiteSpace: "pre-wrap",
3435
+ overflowWrap: "break-word"
3465
3436
  },
3466
- gap: 2,
3467
- mb: 2,
3468
- justifyContent: "flex-end"
3469
- },
3470
- children: [
3471
- /* @__PURE__ */ jsxs4(
3472
- Box5,
3437
+ children: /* @__PURE__ */ jsx5(
3438
+ Typography3,
3473
3439
  {
3474
3440
  sx: {
3475
- display: "flex",
3476
- flexDirection: "column",
3477
- alignItems: "center"
3441
+ color: theme.palette.text.primary,
3442
+ lineHeight: 1.5,
3443
+ wordBreak: "break-word",
3444
+ whiteSpace: "pre-wrap"
3478
3445
  },
3479
- children: [
3480
- /* @__PURE__ */ jsx5(
3481
- Avatar,
3482
- {
3483
- alt: "You",
3484
- src: userAvatar,
3485
- sx: {
3486
- display: { xs: "none", sm: "flex" },
3487
- width: { sm: 72 },
3488
- height: { sm: 72 },
3489
- bgcolor: chatResponse.userAvatarBackground || (theme.palette.mode === "dark" ? "transparent" : "#eee"),
3490
- color: "#fff",
3491
- fontWeight: "bold",
3492
- fontSize: { sm: "1.1rem" },
3493
- border: "2px solid #a78bfa",
3494
- boxShadow: "0 0 8px rgba(167, 139, 250, 0.3)",
3495
- transform: "scaleX(1)"
3496
- }
3497
- }
3498
- ),
3499
- /* @__PURE__ */ jsx5(
3500
- Typography3,
3501
- {
3502
- variant: "caption",
3503
- sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
3504
- children: "You said"
3505
- }
3506
- )
3507
- ]
3446
+ children: question
3508
3447
  }
3509
- ),
3510
- /* @__PURE__ */ jsxs4(Box5, { sx: { flex: 1 }, children: [
3511
- /* @__PURE__ */ jsx5(
3512
- Box5,
3513
- {
3514
- sx: {
3515
- display: "inline-block",
3516
- textAlign: "left",
3517
- bgcolor: chatResponse.userBubble || "#1f1f1f",
3518
- borderRadius: "4px",
3519
- px: isMobile ? 1 : 2,
3520
- py: 1.5,
3521
- width: isMobile ? "100%" : "fit-content",
3522
- maxWidth: "100%",
3523
- border: "1px solid " + (chatResponse.aiBorder || "#444"),
3524
- wordBreak: "break-word",
3525
- whiteSpace: "pre-wrap",
3526
- overflowWrap: "break-word",
3527
- mt: { xs: 0.5, sm: 0.25 }
3528
- },
3529
- children: /* @__PURE__ */ jsx5(
3530
- Typography3,
3531
- {
3532
- sx: {
3533
- color: chatResponse.userText || "#6C9AC5",
3534
- fontStyle: "italic",
3535
- wordBreak: "break-word",
3536
- whiteSpace: "pre-wrap"
3537
- },
3538
- children: question
3539
- }
3540
- )
3541
- }
3542
- ),
3543
- images && images.length > 0 && /* @__PURE__ */ jsx5(Box5, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap" }, children: images.map((img, i) => /* @__PURE__ */ jsx5(
3544
- Avatar,
3545
- {
3546
- src: img,
3547
- variant: "rounded",
3548
- onClick: () => setOpenImage(img),
3549
- sx: {
3550
- width: 64,
3551
- height: 64,
3552
- borderRadius: 2,
3553
- cursor: "pointer",
3554
- "&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
3555
- }
3556
- },
3557
- i
3558
- )) })
3559
- ] })
3560
- ]
3561
- }
3562
- ),
3563
- /* @__PURE__ */ jsx5(Box5, { sx: { borderBottom: `1px solid ${theme.palette.divider}`, my: 2 } }),
3564
- /* @__PURE__ */ jsxs4(
3565
- Box5,
3566
- {
3567
- sx: {
3568
- display: "flex",
3569
- flexDirection: "column",
3570
- alignItems: {
3571
- xs: "center",
3572
- sm: "flex-start"
3573
- },
3574
- gap: 2,
3575
- mb: 2
3448
+ )
3449
+ }
3450
+ ),
3451
+ images && images.length > 0 && /* @__PURE__ */ jsx5(Box5, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap", justifyContent: "flex-end" }, children: images.map((img, i) => /* @__PURE__ */ jsx5(
3452
+ Avatar,
3453
+ {
3454
+ src: img,
3455
+ variant: "rounded",
3456
+ onClick: () => setOpenImage(img),
3457
+ sx: {
3458
+ width: 96,
3459
+ height: 96,
3460
+ borderRadius: 2,
3461
+ border: `1px solid ${alpha(theme.palette.text.primary, 0.25)}`,
3462
+ cursor: "pointer",
3463
+ "&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
3464
+ }
3576
3465
  },
3577
- children: [
3578
- typeof response === "string" && response.trim() !== "" && /* @__PURE__ */ jsxs4(
3579
- Box5,
3580
- {
3581
- sx: {
3582
- display: "flex",
3583
- flexDirection: "column",
3584
- alignItems: "center",
3585
- mr: 2,
3586
- position: "relative"
3587
- },
3588
- children: [
3589
- /* @__PURE__ */ jsx5(
3590
- Avatar,
3591
- {
3592
- src: resolveAvatar(selectedModel),
3593
- alt: selectedModel,
3594
- sx: {
3595
- display: { xs: "none", sm: "flex" },
3596
- width: 72,
3597
- height: 72,
3598
- border: "1px solid #888",
3599
- boxShadow: "0 0 6px rgba(136, 136, 136, 0.4)",
3600
- filter: "brightness(1.6)"
3601
- }
3602
- }
3603
- ),
3604
- /* @__PURE__ */ jsx5(Box5, { sx: { display: { xs: "none", sm: "block" } }, children: /* @__PURE__ */ jsxs4(
3605
- Typography3,
3606
- {
3607
- variant: "caption",
3608
- sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
3609
- children: [
3610
- selectedModel,
3611
- " says"
3612
- ]
3613
- }
3614
- ) })
3615
- ]
3616
- }
3617
- ),
3618
- /* @__PURE__ */ jsx5(
3619
- Box5,
3620
- {
3621
- sx: {
3622
- display: { xs: "flex", sm: "none" },
3623
- justifyContent: "right",
3624
- width: "100%",
3625
- mt: -1,
3626
- mb: 1
3627
- },
3628
- children: /* @__PURE__ */ jsxs4(
3629
- Typography3,
3630
- {
3631
- variant: "caption",
3632
- sx: { fontStyle: "italic", color: chatResponse.modelLabel || "#888" },
3633
- children: [
3634
- selectedModel,
3635
- " says"
3636
- ]
3637
- }
3638
- )
3639
- }
3640
- ),
3641
- /* @__PURE__ */ jsxs4(Box5, { sx: { position: "relative", width: "100%" }, children: [
3642
- cancelled && /* @__PURE__ */ jsx5(
3643
- Box5,
3644
- {
3645
- sx: {
3646
- position: "absolute",
3647
- top: -24,
3648
- left: 0,
3649
- display: "flex",
3650
- alignItems: "center",
3651
- gap: 1,
3652
- pl: 1,
3653
- zIndex: 1
3654
- },
3655
- children: /* @__PURE__ */ jsx5(Typography3, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
3656
- }
3657
- ),
3658
- showMemoryUpdated && /* @__PURE__ */ jsxs4(
3659
- Box5,
3660
- {
3661
- sx: {
3662
- position: "absolute",
3663
- top: -24,
3664
- right: 0,
3665
- display: "flex",
3666
- alignItems: "center",
3667
- gap: 1,
3668
- pr: 1,
3669
- animation: "fadeOut 0.3s ease-in 2.7s forwards",
3670
- zIndex: 1
3671
- },
3672
- children: [
3673
- /* @__PURE__ */ jsx5(
3674
- "img",
3675
- {
3676
- src: brainIcon,
3677
- alt: "Memory",
3678
- style: { width: 18, height: 18 }
3679
- }
3680
- ),
3681
- /* @__PURE__ */ jsx5(
3682
- Typography3,
3683
- {
3684
- variant: "caption",
3685
- sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
3686
- children: "Bandit added to memory"
3687
- }
3688
- )
3689
- ]
3690
- }
3691
- ),
3466
+ i
3467
+ )) })
3468
+ ] }) }),
3469
+ /* @__PURE__ */ jsxs4(Box5, { sx: { position: "relative", width: "100%", maxWidth: { xs: "100%", sm: "768px" } }, children: [
3470
+ cancelled && /* @__PURE__ */ jsx5(
3471
+ Box5,
3472
+ {
3473
+ sx: {
3474
+ position: "absolute",
3475
+ top: -22,
3476
+ left: 0,
3477
+ display: "flex",
3478
+ alignItems: "center",
3479
+ gap: 1,
3480
+ zIndex: 1
3481
+ },
3482
+ children: /* @__PURE__ */ jsx5(Typography3, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
3483
+ }
3484
+ ),
3485
+ showMemoryUpdated && /* @__PURE__ */ jsxs4(
3486
+ Box5,
3487
+ {
3488
+ sx: {
3489
+ position: "absolute",
3490
+ top: -22,
3491
+ right: 0,
3492
+ display: "flex",
3493
+ alignItems: "center",
3494
+ gap: 1,
3495
+ animation: "fadeOut 0.3s ease-in 2.7s forwards",
3496
+ zIndex: 1
3497
+ },
3498
+ children: [
3499
+ /* @__PURE__ */ jsx5("img", { src: brainIcon, alt: "Memory", style: { width: 16, height: 16 } }),
3692
3500
  /* @__PURE__ */ jsx5(
3693
- Box5,
3501
+ Typography3,
3694
3502
  {
3695
- sx: {
3696
- bgcolor: chatResponse.aiBubble ?? "#2f2f2f",
3697
- borderRadius: "4px",
3698
- px: isMobile ? 1 : 1.5,
3699
- // Reduced padding on mobile
3700
- py: 1.25,
3701
- width: "100%",
3702
- maxWidth: isMobile ? "100%" : "768px",
3703
- // Full width on mobile
3704
- border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
3705
- wordBreak: "break-word",
3706
- alignSelf: "flex-start",
3707
- mt: { xs: 0.5, sm: 0.25 }
3708
- },
3709
- children: /* @__PURE__ */ jsx5(Box5, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ jsx5(
3710
- ReactMarkdown,
3711
- {
3712
- remarkPlugins: [remarkGfm],
3713
- rehypePlugins: [rehypeRaw, [rehypeSanitize, markdownSanitizeSchema]],
3714
- components,
3715
- children: enrichedMarkdown ?? sanitizeMarkdown(response)
3716
- }
3717
- ) : React5.isValidElement(response) ? response : /* @__PURE__ */ jsx5(Typography3, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
3503
+ variant: "caption",
3504
+ sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
3505
+ children: "Bandit added to memory"
3718
3506
  }
3719
3507
  )
3720
- ] })
3721
- ]
3722
- }
3723
- ),
3508
+ ]
3509
+ }
3510
+ ),
3511
+ /* @__PURE__ */ jsx5(Box5, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ jsx5(
3512
+ ReactMarkdown,
3513
+ {
3514
+ remarkPlugins: [remarkGfm],
3515
+ rehypePlugins: [rehypeRaw, [rehypeSanitize, markdownSanitizeSchema]],
3516
+ components,
3517
+ children: enrichedMarkdown ?? sanitizeMarkdown(response)
3518
+ }
3519
+ ) : React5.isValidElement(response) ? response : /* @__PURE__ */ jsx5(Typography3, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
3520
+ ] }),
3724
3521
  !!(responseText || typeof response === "string" && response) && /* @__PURE__ */ jsx5(ai_response_action_bar_default, { text: responseText || response }),
3725
3522
  displaySourceFiles && displaySourceFiles.length > 0 && /* @__PURE__ */ jsx5(Box5, { sx: { mt: 1.5, display: "flex", gap: 2, flexWrap: "wrap", justifyContent: "flex-start" }, children: displaySourceFiles.map((doc, idx) => {
3726
3523
  debugLogger.debug("Rendering DocumentCard in AI response", {
@@ -9209,4 +9006,4 @@ export {
9209
9006
  FeedbackButton,
9210
9007
  useNotificationService
9211
9008
  };
9212
- //# sourceMappingURL=chunk-5WQMMCZQ.mjs.map
9009
+ //# sourceMappingURL=chunk-FXFTA5PZ.mjs.map