@burtson-labs/bandit-engine 2.0.129 → 2.0.131
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/{chat-TO26ORKD.mjs → chat-3O4KKYCG.mjs} +4 -4
- package/dist/{chunk-3LOS2EAN.mjs → chunk-BVMTZTGQ.mjs} +343 -156
- package/dist/chunk-BVMTZTGQ.mjs.map +1 -0
- package/dist/{chunk-FWFDOSRM.mjs → chunk-BVYSGIWG.mjs} +2 -2
- package/dist/{chunk-BQW7DSJ6.mjs → chunk-JONBKV2S.mjs} +177 -302
- package/dist/chunk-JONBKV2S.mjs.map +1 -0
- package/dist/{chunk-N3TVVQVS.mjs → chunk-PA4VYO4R.mjs} +207 -69
- package/dist/chunk-PA4VYO4R.mjs.map +1 -0
- package/dist/{chunk-VXGJ4XH6.mjs → chunk-VNIDC6VZ.mjs} +57 -35
- package/dist/chunk-VNIDC6VZ.mjs.map +1 -0
- package/dist/index.js +2195 -1981
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/management/management.js +628 -413
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +4 -4
- package/dist/modals/chat-modal/chat-modal.js +16 -3
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-3LOS2EAN.mjs.map +0 -1
- package/dist/chunk-BQW7DSJ6.mjs.map +0 -1
- package/dist/chunk-N3TVVQVS.mjs.map +0 -1
- package/dist/chunk-VXGJ4XH6.mjs.map +0 -1
- /package/dist/{chat-TO26ORKD.mjs.map → chat-3O4KKYCG.mjs.map} +0 -0
- /package/dist/{chunk-FWFDOSRM.mjs.map → chunk-BVYSGIWG.mjs.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ONQMRE2G.mjs";
|
|
4
4
|
import {
|
|
5
5
|
StreamingMarkdown_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BVYSGIWG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useMCPToolsStore
|
|
9
9
|
} from "./chunk-K2JGFKEB.mjs";
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
CloseIcon,
|
|
17
17
|
ComposeIcon,
|
|
18
18
|
ExpandMoreIcon,
|
|
19
|
-
FeedbackButton,
|
|
20
19
|
FeedbackIcon,
|
|
21
20
|
FeedbackModal,
|
|
22
21
|
GhostIcon,
|
|
@@ -39,7 +38,7 @@ import {
|
|
|
39
38
|
useNotificationService,
|
|
40
39
|
useTTS,
|
|
41
40
|
useVoiceStore
|
|
42
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-JONBKV2S.mjs";
|
|
43
42
|
import {
|
|
44
43
|
brandingService_default,
|
|
45
44
|
detectMessageMood,
|
|
@@ -81,7 +80,7 @@ import {
|
|
|
81
80
|
} from "./chunk-KCI46M23.mjs";
|
|
82
81
|
|
|
83
82
|
// src/chat/chat.tsx
|
|
84
|
-
import { useCallback as useCallback6, useEffect as
|
|
83
|
+
import { useCallback as useCallback6, useEffect as useEffect17, useLayoutEffect, useMemo as useMemo4, useRef as useRef15, useState as useState19 } from "react";
|
|
85
84
|
|
|
86
85
|
// src/chat/custom-logo.tsx
|
|
87
86
|
import React, { useEffect } from "react";
|
|
@@ -168,7 +167,7 @@ var Logo = ({ visible, atTop = false }) => {
|
|
|
168
167
|
var custom_logo_default = Logo;
|
|
169
168
|
|
|
170
169
|
// src/chat/chat.tsx
|
|
171
|
-
import { Box as
|
|
170
|
+
import { Box as Box20, ThemeProvider, CssBaseline, CircularProgress as CircularProgress4, Typography as Typography15 } from "@mui/material";
|
|
172
171
|
import { createTheme } from "@mui/material/styles";
|
|
173
172
|
|
|
174
173
|
// src/chat/canvas-panel.tsx
|
|
@@ -723,6 +722,18 @@ var source_chips_default = SourceChips;
|
|
|
723
722
|
// src/chat/chat-messages.tsx
|
|
724
723
|
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
725
724
|
var WORKING_TOKEN_RE = /\s*<<working:([^>]*)>>\s*$/;
|
|
725
|
+
var BYTE_TOKEN_RUN_RE = /(?:<0x[0-9A-Fa-f]{2}>)+/g;
|
|
726
|
+
var decodeByteTokens = (text) => {
|
|
727
|
+
if (!text || text.indexOf("<0x") === -1) return text;
|
|
728
|
+
return text.replace(BYTE_TOKEN_RUN_RE, (run) => {
|
|
729
|
+
const bytes = Array.from(run.matchAll(/<0x([0-9A-Fa-f]{2})>/g), (m) => parseInt(m[1], 16));
|
|
730
|
+
try {
|
|
731
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(new Uint8Array(bytes));
|
|
732
|
+
} catch {
|
|
733
|
+
return "";
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
};
|
|
726
737
|
var ToolWorkingChip = ({ label }) => /* @__PURE__ */ jsxs3(
|
|
727
738
|
Box4,
|
|
728
739
|
{
|
|
@@ -773,7 +784,7 @@ var ChatMessages = ({
|
|
|
773
784
|
const lastIndex = history.length - 1;
|
|
774
785
|
const hasActivePlaceholder = lastIndex >= 0 && history[lastIndex]?.answer === "...";
|
|
775
786
|
if (!responseStarted && !pendingMessage && history.length === 0) return null;
|
|
776
|
-
return /* @__PURE__ */ jsxs3(Box4, { sx: { px: isMobile ? 0 : 0, pt: "100px", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
787
|
+
return /* @__PURE__ */ jsxs3(Box4, { sx: { px: isMobile ? 0 : 0, pt: "calc(100px + env(safe-area-inset-top, 0px))", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
777
788
|
history.map((entry, index) => {
|
|
778
789
|
const isLast = index === lastIndex;
|
|
779
790
|
const isPlaceholder = entry.answer === "...";
|
|
@@ -781,7 +792,9 @@ var ChatMessages = ({
|
|
|
781
792
|
const showThinking = showLoader && isThinking;
|
|
782
793
|
const rawContent = isLast ? isStreaming ? streamBuffer || "" : isPlaceholder ? "" : entry.answer : entry.answer;
|
|
783
794
|
const workingMatch = isLast && isStreaming ? rawContent.match(WORKING_TOKEN_RE) : null;
|
|
784
|
-
const content =
|
|
795
|
+
const content = decodeByteTokens(
|
|
796
|
+
workingMatch ? rawContent.replace(WORKING_TOKEN_RE, "") : rawContent
|
|
797
|
+
);
|
|
785
798
|
const rawSources = entry.sourceFiles;
|
|
786
799
|
const sourceSummaries = rawSources ? rawSources.filter((doc) => doc && typeof doc.name === "string" && doc.name.trim()).map((doc) => ({ id: doc.id || doc.name, name: doc.name.trim() })) : void 0;
|
|
787
800
|
const responseNode = /* @__PURE__ */ jsxs3(
|
|
@@ -873,7 +886,8 @@ var ChatMessages = ({
|
|
|
873
886
|
memoryUpdated: entry.memoryUpdated && !isPlaceholder,
|
|
874
887
|
sourceFiles: rawSources,
|
|
875
888
|
isMobile,
|
|
876
|
-
cancelled: entry.cancelled
|
|
889
|
+
cancelled: entry.cancelled,
|
|
890
|
+
revealActionsOnHover: !isLast && !isMobile
|
|
877
891
|
}
|
|
878
892
|
) }, index);
|
|
879
893
|
}),
|
|
@@ -5348,7 +5362,7 @@ import {
|
|
|
5348
5362
|
Avatar as Avatar6,
|
|
5349
5363
|
alpha as alpha8
|
|
5350
5364
|
} from "@mui/material";
|
|
5351
|
-
import { X as CloseIcon6, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4, Settings as SettingsIcon, Brain as MemoryIcon, LogOut as LogOutIcon, House as HomeLucideIcon, RefreshCw as SyncLucideIcon, CircleAlert as SyncErrorIcon, SlidersHorizontal as ManagementIcon } from "lucide-react";
|
|
5365
|
+
import { X as CloseIcon6, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4, Settings as SettingsIcon, Brain as MemoryIcon, LogOut as LogOutIcon, House as HomeLucideIcon, RefreshCw as SyncLucideIcon, CircleAlert as SyncErrorIcon, SlidersHorizontal as ManagementIcon, MessageSquare as FeedbackMenuIcon } from "lucide-react";
|
|
5352
5366
|
import { useTheme as useTheme13 } from "@mui/material/styles";
|
|
5353
5367
|
|
|
5354
5368
|
// src/chat/project-management-modal.tsx
|
|
@@ -6938,6 +6952,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6938
6952
|
const [searchQuery, setSearchQuery] = useState14("");
|
|
6939
6953
|
const [menuAnchorEl, setMenuAnchorEl] = useState14(null);
|
|
6940
6954
|
const [clearConfirmOpen, setClearConfirmOpen] = useState14(false);
|
|
6955
|
+
const [feedbackOpen, setFeedbackOpen] = useState14(false);
|
|
6941
6956
|
const [moveModalOpen, setMoveModalOpen] = useState14(false);
|
|
6942
6957
|
const [conversationToMove, setConversationToMove] = useState14(null);
|
|
6943
6958
|
const [renameProjectId, setRenameProjectId] = useState14(null);
|
|
@@ -7758,7 +7773,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
7758
7773
|
currentProjectId: conversationToMove.projectId
|
|
7759
7774
|
}
|
|
7760
7775
|
),
|
|
7761
|
-
/* @__PURE__ */
|
|
7776
|
+
/* @__PURE__ */ jsxs13(
|
|
7762
7777
|
Menu5,
|
|
7763
7778
|
{
|
|
7764
7779
|
anchorEl: menuAnchorEl,
|
|
@@ -7772,20 +7787,43 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
7772
7787
|
vertical: "bottom",
|
|
7773
7788
|
horizontal: "right"
|
|
7774
7789
|
},
|
|
7775
|
-
children:
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7790
|
+
children: [
|
|
7791
|
+
preferences.feedbackEnabled && /* @__PURE__ */ jsxs13(
|
|
7792
|
+
MenuItem5,
|
|
7793
|
+
{
|
|
7794
|
+
onClick: () => {
|
|
7795
|
+
setFeedbackOpen(true);
|
|
7796
|
+
handleMenuClose();
|
|
7797
|
+
},
|
|
7798
|
+
children: [
|
|
7799
|
+
/* @__PURE__ */ jsx16(ListItemIcon3, { children: /* @__PURE__ */ jsx16(FeedbackMenuIcon, { size: 16 }) }),
|
|
7800
|
+
/* @__PURE__ */ jsx16(ListItemText3, { children: "Send feedback" })
|
|
7801
|
+
]
|
|
7802
|
+
}
|
|
7803
|
+
),
|
|
7804
|
+
/* @__PURE__ */ jsxs13(
|
|
7805
|
+
MenuItem5,
|
|
7806
|
+
{
|
|
7807
|
+
onClick: () => {
|
|
7808
|
+
setClearConfirmOpen(true);
|
|
7809
|
+
handleMenuClose();
|
|
7810
|
+
},
|
|
7811
|
+
sx: { color: theme.palette.error.main },
|
|
7812
|
+
children: [
|
|
7813
|
+
/* @__PURE__ */ jsx16(ListItemIcon3, { children: /* @__PURE__ */ jsx16(DeleteSweepIcon, { size: 16, color: theme.palette.error.main }) }),
|
|
7814
|
+
/* @__PURE__ */ jsx16(ListItemText3, { children: "Clear All Conversations" })
|
|
7815
|
+
]
|
|
7816
|
+
}
|
|
7817
|
+
)
|
|
7818
|
+
]
|
|
7819
|
+
}
|
|
7820
|
+
),
|
|
7821
|
+
preferences.feedbackEnabled && /* @__PURE__ */ jsx16(
|
|
7822
|
+
FeedbackModal,
|
|
7823
|
+
{
|
|
7824
|
+
open: feedbackOpen,
|
|
7825
|
+
onClose: () => setFeedbackOpen(false),
|
|
7826
|
+
feedbackEmail: usePackageSettingsStore.getState().settings?.feedbackEmail
|
|
7789
7827
|
}
|
|
7790
7828
|
),
|
|
7791
7829
|
/* @__PURE__ */ jsxs13(
|
|
@@ -8226,7 +8264,10 @@ var EnhancedMobileConversationsModal = ({
|
|
|
8226
8264
|
display: "flex",
|
|
8227
8265
|
flexDirection: "column",
|
|
8228
8266
|
overflow: "hidden",
|
|
8229
|
-
outline: "none"
|
|
8267
|
+
outline: "none",
|
|
8268
|
+
// Edge-to-edge PWA: the drawer surface runs under the status
|
|
8269
|
+
// bar (like Claude); its content starts below it.
|
|
8270
|
+
pt: "env(safe-area-inset-top, 0px)"
|
|
8230
8271
|
},
|
|
8231
8272
|
children: [
|
|
8232
8273
|
/* @__PURE__ */ jsx17(
|
|
@@ -9093,6 +9134,8 @@ var ChatAppBar = ({
|
|
|
9093
9134
|
width: "100%",
|
|
9094
9135
|
px: 2,
|
|
9095
9136
|
py: 1,
|
|
9137
|
+
// Edge-to-edge PWA: keep the pills below the status bar / notch.
|
|
9138
|
+
pt: "calc(8px + env(safe-area-inset-top, 0px))",
|
|
9096
9139
|
display: "flex",
|
|
9097
9140
|
alignItems: "center",
|
|
9098
9141
|
justifyContent: "space-between",
|
|
@@ -9694,14 +9737,170 @@ var UnderReview = () => {
|
|
|
9694
9737
|
};
|
|
9695
9738
|
var UnderReview_default = UnderReview;
|
|
9696
9739
|
|
|
9740
|
+
// src/components/feedback/FeedbackPulse.tsx
|
|
9741
|
+
import { useEffect as useEffect15, useRef as useRef13, useState as useState18 } from "react";
|
|
9742
|
+
import { Box as Box18, IconButton as IconButton13, Paper as Paper2, Slide as Slide2, Typography as Typography14 } from "@mui/material";
|
|
9743
|
+
import { useTheme as useTheme18, alpha as alpha11 } from "@mui/material/styles";
|
|
9744
|
+
import { X as CloseIcon8 } from "lucide-react";
|
|
9745
|
+
import { Fragment as Fragment12, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
9746
|
+
var STORAGE_KEY2 = "bandit-feedback-pulse-last";
|
|
9747
|
+
var COOLDOWN_DAYS = 14;
|
|
9748
|
+
var MIN_SESSION_MS = 5 * 60 * 1e3;
|
|
9749
|
+
var MIN_MESSAGES_SENT = 2;
|
|
9750
|
+
var CHECK_INTERVAL_MS = 30 * 1e3;
|
|
9751
|
+
var readLastInteraction = () => {
|
|
9752
|
+
try {
|
|
9753
|
+
return Number(localStorage.getItem(STORAGE_KEY2)) || 0;
|
|
9754
|
+
} catch {
|
|
9755
|
+
return 0;
|
|
9756
|
+
}
|
|
9757
|
+
};
|
|
9758
|
+
var recordInteraction = (outcome) => {
|
|
9759
|
+
try {
|
|
9760
|
+
localStorage.setItem(STORAGE_KEY2, String(Date.now()));
|
|
9761
|
+
} catch {
|
|
9762
|
+
}
|
|
9763
|
+
debugLogger.info("FeedbackPulse: interaction recorded", { outcome });
|
|
9764
|
+
};
|
|
9765
|
+
var FeedbackPulse = ({ isMobile, feedbackEmail }) => {
|
|
9766
|
+
const theme = useTheme18();
|
|
9767
|
+
const [visible, setVisible] = useState18(false);
|
|
9768
|
+
const [thanked, setThanked] = useState18(false);
|
|
9769
|
+
const [modalOpen, setModalOpen] = useState18(false);
|
|
9770
|
+
const mountedAtRef = useRef13(Date.now());
|
|
9771
|
+
const baselineMessagesRef = useRef13(null);
|
|
9772
|
+
const totalMessages = useConversationStore(
|
|
9773
|
+
(s) => s.conversations.reduce((n, c) => n + c.history.length, 0)
|
|
9774
|
+
);
|
|
9775
|
+
const hydrated = useConversationStore((s) => s._hasHydrated);
|
|
9776
|
+
useEffect15(() => {
|
|
9777
|
+
if (hydrated && baselineMessagesRef.current === null) {
|
|
9778
|
+
baselineMessagesRef.current = totalMessages;
|
|
9779
|
+
}
|
|
9780
|
+
}, [hydrated, totalMessages]);
|
|
9781
|
+
useEffect15(() => {
|
|
9782
|
+
const cooldownMs = COOLDOWN_DAYS * 24 * 60 * 60 * 1e3;
|
|
9783
|
+
const forced = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("feedbackPulse");
|
|
9784
|
+
const check = () => {
|
|
9785
|
+
if (visible || thanked || modalOpen) return;
|
|
9786
|
+
if (forced) {
|
|
9787
|
+
setVisible(true);
|
|
9788
|
+
return;
|
|
9789
|
+
}
|
|
9790
|
+
if (Date.now() - readLastInteraction() < cooldownMs) return;
|
|
9791
|
+
if (Date.now() - mountedAtRef.current < MIN_SESSION_MS) return;
|
|
9792
|
+
const baseline = baselineMessagesRef.current;
|
|
9793
|
+
if (baseline === null) return;
|
|
9794
|
+
const sentThisSession = useConversationStore.getState().conversations.reduce((n, c) => n + c.history.length, 0) - baseline;
|
|
9795
|
+
if (sentThisSession < MIN_MESSAGES_SENT) return;
|
|
9796
|
+
setVisible(true);
|
|
9797
|
+
};
|
|
9798
|
+
if (forced) check();
|
|
9799
|
+
const timer = setInterval(check, CHECK_INTERVAL_MS);
|
|
9800
|
+
return () => clearInterval(timer);
|
|
9801
|
+
}, [visible, thanked, modalOpen]);
|
|
9802
|
+
const answer = (outcome) => {
|
|
9803
|
+
recordInteraction(outcome);
|
|
9804
|
+
if (outcome === "bad") {
|
|
9805
|
+
setVisible(false);
|
|
9806
|
+
setModalOpen(true);
|
|
9807
|
+
return;
|
|
9808
|
+
}
|
|
9809
|
+
setThanked(true);
|
|
9810
|
+
setTimeout(() => {
|
|
9811
|
+
setVisible(false);
|
|
9812
|
+
setThanked(false);
|
|
9813
|
+
}, 1600);
|
|
9814
|
+
};
|
|
9815
|
+
const dismiss = () => {
|
|
9816
|
+
recordInteraction("dismissed");
|
|
9817
|
+
setVisible(false);
|
|
9818
|
+
};
|
|
9819
|
+
const choice = (emoji, label, outcome) => /* @__PURE__ */ jsxs17(
|
|
9820
|
+
Box18,
|
|
9821
|
+
{
|
|
9822
|
+
component: "button",
|
|
9823
|
+
type: "button",
|
|
9824
|
+
onClick: () => answer(outcome),
|
|
9825
|
+
sx: {
|
|
9826
|
+
font: "inherit",
|
|
9827
|
+
display: "flex",
|
|
9828
|
+
flexDirection: "column",
|
|
9829
|
+
alignItems: "center",
|
|
9830
|
+
gap: 0.25,
|
|
9831
|
+
px: 1.5,
|
|
9832
|
+
py: 0.75,
|
|
9833
|
+
border: "none",
|
|
9834
|
+
borderRadius: 2,
|
|
9835
|
+
cursor: "pointer",
|
|
9836
|
+
bgcolor: "transparent",
|
|
9837
|
+
color: theme.palette.text.secondary,
|
|
9838
|
+
transition: "background-color 0.15s ease, transform 0.1s ease",
|
|
9839
|
+
"&:hover": {
|
|
9840
|
+
bgcolor: alpha11(theme.palette.text.primary, 0.06),
|
|
9841
|
+
color: theme.palette.text.primary
|
|
9842
|
+
},
|
|
9843
|
+
"&:active": { transform: "scale(0.96)" }
|
|
9844
|
+
},
|
|
9845
|
+
children: [
|
|
9846
|
+
/* @__PURE__ */ jsx21(Box18, { component: "span", sx: { fontSize: "1.3rem", lineHeight: 1 }, children: emoji }),
|
|
9847
|
+
/* @__PURE__ */ jsx21(Typography14, { variant: "caption", sx: { fontWeight: 600 }, children: label })
|
|
9848
|
+
]
|
|
9849
|
+
}
|
|
9850
|
+
);
|
|
9851
|
+
return /* @__PURE__ */ jsxs17(Fragment12, { children: [
|
|
9852
|
+
/* @__PURE__ */ jsx21(Slide2, { direction: isMobile ? "down" : "up", in: visible, mountOnEnter: true, unmountOnExit: true, children: /* @__PURE__ */ jsx21(
|
|
9853
|
+
Paper2,
|
|
9854
|
+
{
|
|
9855
|
+
elevation: 0,
|
|
9856
|
+
sx: {
|
|
9857
|
+
position: "fixed",
|
|
9858
|
+
zIndex: 1350,
|
|
9859
|
+
...isMobile ? {
|
|
9860
|
+
top: `calc(${theme.spacing(8)} + env(safe-area-inset-top, 0px))`,
|
|
9861
|
+
left: "50%",
|
|
9862
|
+
transform: "translateX(-50%) !important",
|
|
9863
|
+
width: "min(92vw, 360px)"
|
|
9864
|
+
} : { bottom: 24, right: 24, width: 320 },
|
|
9865
|
+
p: 1.5,
|
|
9866
|
+
borderRadius: 3,
|
|
9867
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
9868
|
+
bgcolor: theme.palette.background.paper,
|
|
9869
|
+
boxShadow: `0 12px 40px ${alpha11(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
|
|
9870
|
+
},
|
|
9871
|
+
children: thanked ? /* @__PURE__ */ jsx21(Typography14, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback! \u{1F64C}" }) : /* @__PURE__ */ jsxs17(Fragment12, { children: [
|
|
9872
|
+
/* @__PURE__ */ jsxs17(Box18, { sx: { display: "flex", alignItems: "center", mb: 0.5 }, children: [
|
|
9873
|
+
/* @__PURE__ */ jsx21(Typography14, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: "How's Bandit doing?" }),
|
|
9874
|
+
/* @__PURE__ */ jsx21(IconButton13, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ jsx21(CloseIcon8, { size: 16 }) })
|
|
9875
|
+
] }),
|
|
9876
|
+
/* @__PURE__ */ jsxs17(Box18, { sx: { display: "flex", justifyContent: "space-evenly" }, children: [
|
|
9877
|
+
choice("\u{1F60A}", "Good", "good"),
|
|
9878
|
+
choice("\u{1F610}", "Fine", "fine"),
|
|
9879
|
+
choice("\u{1F641}", "Bad", "bad")
|
|
9880
|
+
] })
|
|
9881
|
+
] })
|
|
9882
|
+
}
|
|
9883
|
+
) }),
|
|
9884
|
+
/* @__PURE__ */ jsx21(
|
|
9885
|
+
FeedbackModal,
|
|
9886
|
+
{
|
|
9887
|
+
open: modalOpen,
|
|
9888
|
+
onClose: () => setModalOpen(false),
|
|
9889
|
+
feedbackEmail
|
|
9890
|
+
}
|
|
9891
|
+
)
|
|
9892
|
+
] });
|
|
9893
|
+
};
|
|
9894
|
+
var FeedbackPulse_default = FeedbackPulse;
|
|
9895
|
+
|
|
9697
9896
|
// src/components/ConnectionStatus.tsx
|
|
9698
|
-
import { Box as
|
|
9699
|
-
import { jsx as
|
|
9897
|
+
import { Box as Box19, Chip as Chip5, useTheme as useTheme19 } from "@mui/material";
|
|
9898
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
9700
9899
|
var ConnectionStatus = ({
|
|
9701
9900
|
showWhenGood = false,
|
|
9702
9901
|
position = "top"
|
|
9703
9902
|
}) => {
|
|
9704
|
-
const theme =
|
|
9903
|
+
const theme = useTheme19();
|
|
9705
9904
|
const { isOnline, connectionQuality, isSlowConnection } = useNetworkStatus();
|
|
9706
9905
|
if (connectionQuality === "fast" && !showWhenGood) {
|
|
9707
9906
|
return null;
|
|
@@ -9710,28 +9909,28 @@ var ConnectionStatus = ({
|
|
|
9710
9909
|
switch (connectionQuality) {
|
|
9711
9910
|
case "offline":
|
|
9712
9911
|
return {
|
|
9713
|
-
icon: /* @__PURE__ */
|
|
9912
|
+
icon: /* @__PURE__ */ jsx22(WifiOffIcon, { sx: { fontSize: 16 } }),
|
|
9714
9913
|
label: "Offline",
|
|
9715
9914
|
color: "error",
|
|
9716
9915
|
severity: "high"
|
|
9717
9916
|
};
|
|
9718
9917
|
case "slow":
|
|
9719
9918
|
return {
|
|
9720
|
-
icon: /* @__PURE__ */
|
|
9919
|
+
icon: /* @__PURE__ */ jsx22(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
|
|
9721
9920
|
label: "Slow connection",
|
|
9722
9921
|
color: "warning",
|
|
9723
9922
|
severity: "medium"
|
|
9724
9923
|
};
|
|
9725
9924
|
case "fast":
|
|
9726
9925
|
return {
|
|
9727
|
-
icon: /* @__PURE__ */
|
|
9926
|
+
icon: /* @__PURE__ */ jsx22(WifiIcon, { sx: { fontSize: 16 } }),
|
|
9728
9927
|
label: "Connected",
|
|
9729
9928
|
color: "success",
|
|
9730
9929
|
severity: "low"
|
|
9731
9930
|
};
|
|
9732
9931
|
default:
|
|
9733
9932
|
return {
|
|
9734
|
-
icon: /* @__PURE__ */
|
|
9933
|
+
icon: /* @__PURE__ */ jsx22(WifiIcon, { sx: { fontSize: 16 } }),
|
|
9735
9934
|
label: "Unknown",
|
|
9736
9935
|
color: "default",
|
|
9737
9936
|
severity: "low"
|
|
@@ -9739,8 +9938,8 @@ var ConnectionStatus = ({
|
|
|
9739
9938
|
}
|
|
9740
9939
|
};
|
|
9741
9940
|
const config = getStatusConfig();
|
|
9742
|
-
return /* @__PURE__ */
|
|
9743
|
-
|
|
9941
|
+
return /* @__PURE__ */ jsx22(
|
|
9942
|
+
Box19,
|
|
9744
9943
|
{
|
|
9745
9944
|
sx: {
|
|
9746
9945
|
position: "fixed",
|
|
@@ -9755,7 +9954,7 @@ var ConnectionStatus = ({
|
|
|
9755
9954
|
"100%": { opacity: 1 }
|
|
9756
9955
|
}
|
|
9757
9956
|
},
|
|
9758
|
-
children: /* @__PURE__ */
|
|
9957
|
+
children: /* @__PURE__ */ jsx22(
|
|
9759
9958
|
Chip5,
|
|
9760
9959
|
{
|
|
9761
9960
|
icon: config.icon,
|
|
@@ -9779,7 +9978,7 @@ var ConnectionStatus = ({
|
|
|
9779
9978
|
};
|
|
9780
9979
|
|
|
9781
9980
|
// src/hooks/useVoiceMode.ts
|
|
9782
|
-
import { useEffect as
|
|
9981
|
+
import { useEffect as useEffect16, useRef as useRef14 } from "react";
|
|
9783
9982
|
var RMS_BASELINE = 128;
|
|
9784
9983
|
var RMS_NORMALIZER = 128;
|
|
9785
9984
|
var computeRms = (data) => {
|
|
@@ -9809,11 +10008,11 @@ var useVoiceMode = (config) => {
|
|
|
9809
10008
|
const setError = useVoiceModeStore((state) => state.setError);
|
|
9810
10009
|
const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
|
|
9811
10010
|
const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
|
|
9812
|
-
const configRef =
|
|
9813
|
-
|
|
10011
|
+
const configRef = useRef14(config);
|
|
10012
|
+
useEffect16(() => {
|
|
9814
10013
|
configRef.current = config;
|
|
9815
10014
|
}, [config]);
|
|
9816
|
-
|
|
10015
|
+
useEffect16(() => {
|
|
9817
10016
|
if (!enabled) {
|
|
9818
10017
|
return () => void 0;
|
|
9819
10018
|
}
|
|
@@ -10068,7 +10267,7 @@ var useVoiceMode = (config) => {
|
|
|
10068
10267
|
};
|
|
10069
10268
|
|
|
10070
10269
|
// src/chat/chat.tsx
|
|
10071
|
-
import { Fragment as
|
|
10270
|
+
import { Fragment as Fragment13, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10072
10271
|
var ChatContent = () => {
|
|
10073
10272
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
10074
10273
|
const UnderReviewView = packageSettings?.components?.UnderReview ?? UnderReview_default;
|
|
@@ -10077,8 +10276,8 @@ var ChatContent = () => {
|
|
|
10077
10276
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
10078
10277
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
10079
10278
|
const notificationService = useNotificationService();
|
|
10080
|
-
const [selectedTheme, setSelectedTheme] =
|
|
10081
|
-
const [themeLoading, setThemeLoading] =
|
|
10279
|
+
const [selectedTheme, setSelectedTheme] = useState19(null);
|
|
10280
|
+
const [themeLoading, setThemeLoading] = useState19(true);
|
|
10082
10281
|
const token = authenticationService.getToken();
|
|
10083
10282
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
10084
10283
|
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
@@ -10130,12 +10329,12 @@ var ChatContent = () => {
|
|
|
10130
10329
|
} = useVoiceStore();
|
|
10131
10330
|
const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
|
|
10132
10331
|
const canvasOpen = useCanvasStore((state) => state.open);
|
|
10133
|
-
const previousVoiceModeEnabledRef =
|
|
10134
|
-
const historyRef =
|
|
10135
|
-
|
|
10332
|
+
const previousVoiceModeEnabledRef = useRef15(isVoiceModeEnabled);
|
|
10333
|
+
const historyRef = useRef15(history);
|
|
10334
|
+
useEffect17(() => {
|
|
10136
10335
|
historyRef.current = history;
|
|
10137
10336
|
}, [history]);
|
|
10138
|
-
|
|
10337
|
+
useEffect17(() => {
|
|
10139
10338
|
if (!hydrated) return;
|
|
10140
10339
|
const params = new URLSearchParams(window.location.search);
|
|
10141
10340
|
const title = params.get("title") || "";
|
|
@@ -10151,7 +10350,7 @@ var ChatContent = () => {
|
|
|
10151
10350
|
stop: ttsStop,
|
|
10152
10351
|
isAvailable: isTTSAvailable
|
|
10153
10352
|
} = useTTS();
|
|
10154
|
-
|
|
10353
|
+
useEffect17(() => {
|
|
10155
10354
|
const timer = setTimeout(() => {
|
|
10156
10355
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
10157
10356
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -10165,7 +10364,7 @@ var ChatContent = () => {
|
|
|
10165
10364
|
}, 500);
|
|
10166
10365
|
return () => clearTimeout(timer);
|
|
10167
10366
|
}, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
|
|
10168
|
-
|
|
10367
|
+
useEffect17(() => {
|
|
10169
10368
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
10170
10369
|
if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
|
|
10171
10370
|
if (token && isAuthenticated) {
|
|
@@ -10177,17 +10376,17 @@ var ChatContent = () => {
|
|
|
10177
10376
|
}
|
|
10178
10377
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
10179
10378
|
const provider = useAIProviderStore((state) => state.provider);
|
|
10180
|
-
const inputRef =
|
|
10181
|
-
const [pastedImages, setPastedImages] =
|
|
10182
|
-
const inputContainerRef =
|
|
10183
|
-
const [inputHeight, setInputHeight] =
|
|
10184
|
-
const [isSubmitting, setIsSubmitting] =
|
|
10185
|
-
const [pendingMessage, setPendingMessage] =
|
|
10379
|
+
const inputRef = useRef15(null);
|
|
10380
|
+
const [pastedImages, setPastedImages] = useState19([]);
|
|
10381
|
+
const inputContainerRef = useRef15(null);
|
|
10382
|
+
const [inputHeight, setInputHeight] = useState19(80);
|
|
10383
|
+
const [isSubmitting, setIsSubmitting] = useState19(false);
|
|
10384
|
+
const [pendingMessage, setPendingMessage] = useState19(null);
|
|
10186
10385
|
const { conversations, currentId, _hasHydrated, hydrate, toggleIncognito } = useConversationStore();
|
|
10187
10386
|
const isTemporaryChat = Boolean(conversations.find((c) => c.id === currentId)?.incognito);
|
|
10188
|
-
const [isMobile, setIsMobile] =
|
|
10189
|
-
const [drawerOpen, setDrawerOpen] =
|
|
10190
|
-
const [mobileConversationsOpen, setMobileConversationsOpen] =
|
|
10387
|
+
const [isMobile, setIsMobile] = useState19(false);
|
|
10388
|
+
const [drawerOpen, setDrawerOpen] = useState19(false);
|
|
10389
|
+
const [mobileConversationsOpen, setMobileConversationsOpen] = useState19(false);
|
|
10191
10390
|
const { generateName } = useConversationNameGenerator();
|
|
10192
10391
|
const { preferences } = usePreferencesStore();
|
|
10193
10392
|
const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
|
|
@@ -10199,27 +10398,27 @@ var ChatContent = () => {
|
|
|
10199
10398
|
const chatContainerEl = chatContainerRef.current;
|
|
10200
10399
|
const scrollTargetEl = scrollTargetRef.current;
|
|
10201
10400
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
10202
|
-
const [showScrollToBottom, setShowScrollToBottom] =
|
|
10203
|
-
const [streamBuffer, setStreamBuffer] =
|
|
10204
|
-
const [responseStarted, setResponseStarted] =
|
|
10205
|
-
const [isStreaming, setIsStreaming] =
|
|
10206
|
-
const [isThinking, setIsThinking] =
|
|
10401
|
+
const [showScrollToBottom, setShowScrollToBottom] = useState19(false);
|
|
10402
|
+
const [streamBuffer, setStreamBuffer] = useState19("");
|
|
10403
|
+
const [responseStarted, setResponseStarted] = useState19(false);
|
|
10404
|
+
const [isStreaming, setIsStreaming] = useState19(false);
|
|
10405
|
+
const [isThinking, setIsThinking] = useState19(false);
|
|
10207
10406
|
const initialLogoState = history.length === 0;
|
|
10208
|
-
const [logoVisible, setLogoVisible] =
|
|
10209
|
-
const [logoShouldRender, setLogoShouldRender] =
|
|
10210
|
-
const streamingGraceUntilRef =
|
|
10407
|
+
const [logoVisible, setLogoVisible] = useState19(initialLogoState);
|
|
10408
|
+
const [logoShouldRender, setLogoShouldRender] = useState19(initialLogoState);
|
|
10409
|
+
const streamingGraceUntilRef = useRef15(0);
|
|
10211
10410
|
const GRACE_MS = 450;
|
|
10212
10411
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
10213
10412
|
const GRACE_OFFSET_MOBILE = 20;
|
|
10214
|
-
const followStreamRef =
|
|
10215
|
-
const lastSpokenResponseRef =
|
|
10216
|
-
const previousConversationIdRef =
|
|
10217
|
-
const logoFadeTimeoutRef =
|
|
10218
|
-
const [branding, setBranding] =
|
|
10219
|
-
const [brandingLoading, setBrandingLoading] =
|
|
10220
|
-
const isBrandingLoadInProgressRef =
|
|
10413
|
+
const followStreamRef = useRef15(true);
|
|
10414
|
+
const lastSpokenResponseRef = useRef15(null);
|
|
10415
|
+
const previousConversationIdRef = useRef15(null);
|
|
10416
|
+
const logoFadeTimeoutRef = useRef15(null);
|
|
10417
|
+
const [branding, setBranding] = useState19(null);
|
|
10418
|
+
const [brandingLoading, setBrandingLoading] = useState19(true);
|
|
10419
|
+
const isBrandingLoadInProgressRef = useRef15(false);
|
|
10221
10420
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
10222
|
-
|
|
10421
|
+
useEffect17(() => {
|
|
10223
10422
|
const isEmptyConversation = (history?.length ?? 0) === 0;
|
|
10224
10423
|
const isSending = Boolean(pendingMessage);
|
|
10225
10424
|
const shouldShowLogo = isEmptyConversation && !isSending;
|
|
@@ -10249,7 +10448,7 @@ var ChatContent = () => {
|
|
|
10249
10448
|
}, 500);
|
|
10250
10449
|
}
|
|
10251
10450
|
}, [history, pendingMessage]);
|
|
10252
|
-
|
|
10451
|
+
useEffect17(() => {
|
|
10253
10452
|
if (!brandingLoading && !themeLoading) {
|
|
10254
10453
|
return;
|
|
10255
10454
|
}
|
|
@@ -10265,18 +10464,18 @@ var ChatContent = () => {
|
|
|
10265
10464
|
}, 2500);
|
|
10266
10465
|
return () => window.clearTimeout(timeoutId);
|
|
10267
10466
|
}, [brandingLoading, themeLoading, selectedTheme]);
|
|
10268
|
-
|
|
10467
|
+
useEffect17(() => () => {
|
|
10269
10468
|
if (logoFadeTimeoutRef.current) {
|
|
10270
10469
|
window.clearTimeout(logoFadeTimeoutRef.current);
|
|
10271
10470
|
logoFadeTimeoutRef.current = null;
|
|
10272
10471
|
}
|
|
10273
10472
|
}, []);
|
|
10274
|
-
|
|
10473
|
+
useEffect17(() => {
|
|
10275
10474
|
if (isStreaming && streamBuffer.trim() === "") {
|
|
10276
10475
|
streamingGraceUntilRef.current = Date.now() + GRACE_MS;
|
|
10277
10476
|
}
|
|
10278
10477
|
}, [isStreaming, streamBuffer]);
|
|
10279
|
-
|
|
10478
|
+
useEffect17(() => {
|
|
10280
10479
|
if (!isStreaming) return;
|
|
10281
10480
|
const container = chatContainerRef.current;
|
|
10282
10481
|
if (!container) return;
|
|
@@ -10287,13 +10486,13 @@ var ChatContent = () => {
|
|
|
10287
10486
|
container.scrollTo({ top: targetTop, behavior: "smooth" });
|
|
10288
10487
|
}
|
|
10289
10488
|
}, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
|
|
10290
|
-
|
|
10489
|
+
useEffect17(() => {
|
|
10291
10490
|
if (!_hasHydrated) {
|
|
10292
10491
|
debugLogger.info("Chat component triggering conversation store hydration");
|
|
10293
10492
|
hydrate();
|
|
10294
10493
|
}
|
|
10295
10494
|
}, [_hasHydrated, hydrate]);
|
|
10296
|
-
|
|
10495
|
+
useEffect17(() => {
|
|
10297
10496
|
const loadBrandingAndTheme = async () => {
|
|
10298
10497
|
if (isBrandingLoadInProgressRef.current) {
|
|
10299
10498
|
debugLogger.warn("Branding loading already in progress, skipping");
|
|
@@ -10482,7 +10681,7 @@ var ChatContent = () => {
|
|
|
10482
10681
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
10483
10682
|
};
|
|
10484
10683
|
}, []);
|
|
10485
|
-
|
|
10684
|
+
useEffect17(() => {
|
|
10486
10685
|
if (!chatContainerEl) return;
|
|
10487
10686
|
const blurInputOnTouchScroll = () => {
|
|
10488
10687
|
if (document.activeElement === inputRef.current) inputRef.current?.blur();
|
|
@@ -10490,13 +10689,13 @@ var ChatContent = () => {
|
|
|
10490
10689
|
chatContainerEl.addEventListener("touchmove", blurInputOnTouchScroll, { passive: true });
|
|
10491
10690
|
return () => chatContainerEl.removeEventListener("touchmove", blurInputOnTouchScroll);
|
|
10492
10691
|
}, [chatContainerEl]);
|
|
10493
|
-
|
|
10692
|
+
useEffect17(() => {
|
|
10494
10693
|
const handleResize = () => setIsMobile(window.innerWidth <= 768);
|
|
10495
10694
|
handleResize();
|
|
10496
10695
|
window.addEventListener("resize", handleResize);
|
|
10497
10696
|
return () => window.removeEventListener("resize", handleResize);
|
|
10498
10697
|
}, []);
|
|
10499
|
-
|
|
10698
|
+
useEffect17(() => {
|
|
10500
10699
|
const setViewportHeight = () => {
|
|
10501
10700
|
document.documentElement.style.setProperty(
|
|
10502
10701
|
"--vh",
|
|
@@ -10507,7 +10706,7 @@ var ChatContent = () => {
|
|
|
10507
10706
|
window.addEventListener("resize", setViewportHeight);
|
|
10508
10707
|
return () => window.removeEventListener("resize", setViewportHeight);
|
|
10509
10708
|
}, []);
|
|
10510
|
-
|
|
10709
|
+
useEffect17(() => {
|
|
10511
10710
|
if (!chatContainerEl) return;
|
|
10512
10711
|
let rafId = null;
|
|
10513
10712
|
const update = () => {
|
|
@@ -10526,7 +10725,7 @@ var ChatContent = () => {
|
|
|
10526
10725
|
chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
|
|
10527
10726
|
};
|
|
10528
10727
|
}, [chatContainerEl, getScrollState]);
|
|
10529
|
-
|
|
10728
|
+
useEffect17(() => {
|
|
10530
10729
|
if (!chatContainerEl) return;
|
|
10531
10730
|
let observer = null;
|
|
10532
10731
|
let rafId = null;
|
|
@@ -10561,7 +10760,7 @@ var ChatContent = () => {
|
|
|
10561
10760
|
if (observer) observer.disconnect();
|
|
10562
10761
|
};
|
|
10563
10762
|
}, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
|
|
10564
|
-
|
|
10763
|
+
useEffect17(() => {
|
|
10565
10764
|
const isTransitioning = isStreaming || streamBuffer.trim() === "";
|
|
10566
10765
|
const delay = isTransitioning ? 400 : 100;
|
|
10567
10766
|
const timer = setTimeout(() => {
|
|
@@ -10604,7 +10803,7 @@ var ChatContent = () => {
|
|
|
10604
10803
|
return () => clearTimeout(scrollTimer);
|
|
10605
10804
|
}
|
|
10606
10805
|
}, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
|
|
10607
|
-
|
|
10806
|
+
useEffect17(() => {
|
|
10608
10807
|
const observer = new ResizeObserver(() => {
|
|
10609
10808
|
if (inputContainerRef.current)
|
|
10610
10809
|
setInputHeight(inputContainerRef.current.offsetHeight);
|
|
@@ -10615,7 +10814,7 @@ var ChatContent = () => {
|
|
|
10615
10814
|
}
|
|
10616
10815
|
return () => observer.disconnect();
|
|
10617
10816
|
}, []);
|
|
10618
|
-
|
|
10817
|
+
useEffect17(() => {
|
|
10619
10818
|
if (!hydrated || !_hasHydrated) return;
|
|
10620
10819
|
if (currentId === null) {
|
|
10621
10820
|
useAIQueryStore.setState({ history: [] });
|
|
@@ -10664,7 +10863,7 @@ var ChatContent = () => {
|
|
|
10664
10863
|
setResponse,
|
|
10665
10864
|
setComponentStatus
|
|
10666
10865
|
]);
|
|
10667
|
-
|
|
10866
|
+
useEffect17(() => {
|
|
10668
10867
|
debugLogger.info("Chat component conversation state", {
|
|
10669
10868
|
hasHydrated: _hasHydrated,
|
|
10670
10869
|
conversationCount: conversations.length,
|
|
@@ -10673,7 +10872,7 @@ var ChatContent = () => {
|
|
|
10673
10872
|
storeState: "main-chat"
|
|
10674
10873
|
});
|
|
10675
10874
|
}, [_hasHydrated, conversations, currentId]);
|
|
10676
|
-
|
|
10875
|
+
useEffect17(() => {
|
|
10677
10876
|
if (!_hasHydrated || !chatContainerEl) return;
|
|
10678
10877
|
let rafId = null;
|
|
10679
10878
|
const sync = () => {
|
|
@@ -10863,7 +11062,7 @@ var ChatContent = () => {
|
|
|
10863
11062
|
onInterrupt: handleVoiceInterrupt,
|
|
10864
11063
|
onError: (message) => notificationService?.showError?.(message)
|
|
10865
11064
|
});
|
|
10866
|
-
|
|
11065
|
+
useEffect17(() => {
|
|
10867
11066
|
const previouslyEnabled = previousVoiceModeEnabledRef.current;
|
|
10868
11067
|
previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
|
|
10869
11068
|
if (!previouslyEnabled && isVoiceModeEnabled) {
|
|
@@ -10888,7 +11087,7 @@ var ChatContent = () => {
|
|
|
10888
11087
|
}
|
|
10889
11088
|
}
|
|
10890
11089
|
}, [isVoiceModeEnabled, ttsStop]);
|
|
10891
|
-
|
|
11090
|
+
useEffect17(() => {
|
|
10892
11091
|
if (!isVoiceModeEnabled || !isStreaming) {
|
|
10893
11092
|
return;
|
|
10894
11093
|
}
|
|
@@ -10908,7 +11107,7 @@ var ChatContent = () => {
|
|
|
10908
11107
|
}
|
|
10909
11108
|
lastSpokenResponseRef.current = null;
|
|
10910
11109
|
}, [isStreaming, isVoiceModeEnabled, ttsStop]);
|
|
10911
|
-
|
|
11110
|
+
useEffect17(() => {
|
|
10912
11111
|
if (!isVoiceModeEnabled) {
|
|
10913
11112
|
lastSpokenResponseRef.current = null;
|
|
10914
11113
|
return;
|
|
@@ -10988,10 +11187,10 @@ var ChatContent = () => {
|
|
|
10988
11187
|
}
|
|
10989
11188
|
};
|
|
10990
11189
|
if (!hydrated || brandingLoading || themeLoading) {
|
|
10991
|
-
return /* @__PURE__ */
|
|
10992
|
-
/* @__PURE__ */
|
|
10993
|
-
/* @__PURE__ */
|
|
10994
|
-
|
|
11190
|
+
return /* @__PURE__ */ jsxs18(ThemeProvider, { theme: banditTheme, children: [
|
|
11191
|
+
/* @__PURE__ */ jsx23(CssBaseline, {}),
|
|
11192
|
+
/* @__PURE__ */ jsxs18(
|
|
11193
|
+
Box20,
|
|
10995
11194
|
{
|
|
10996
11195
|
sx: (theme) => ({
|
|
10997
11196
|
minHeight: "100dvh",
|
|
@@ -11004,8 +11203,8 @@ var ChatContent = () => {
|
|
|
11004
11203
|
color: theme.palette.text.primary
|
|
11005
11204
|
}),
|
|
11006
11205
|
children: [
|
|
11007
|
-
/* @__PURE__ */
|
|
11008
|
-
/* @__PURE__ */
|
|
11206
|
+
/* @__PURE__ */ jsx23(CircularProgress4, { size: 32, thickness: 4 }),
|
|
11207
|
+
/* @__PURE__ */ jsx23(Typography15, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
|
|
11009
11208
|
]
|
|
11010
11209
|
}
|
|
11011
11210
|
)
|
|
@@ -11013,15 +11212,15 @@ var ChatContent = () => {
|
|
|
11013
11212
|
}
|
|
11014
11213
|
const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
|
|
11015
11214
|
if (!userHasAccess) {
|
|
11016
|
-
return /* @__PURE__ */
|
|
11017
|
-
/* @__PURE__ */
|
|
11018
|
-
/* @__PURE__ */
|
|
11215
|
+
return /* @__PURE__ */ jsxs18(ThemeProvider, { theme: banditTheme, children: [
|
|
11216
|
+
/* @__PURE__ */ jsx23(CssBaseline, {}),
|
|
11217
|
+
/* @__PURE__ */ jsx23(UnderReviewView, {})
|
|
11019
11218
|
] });
|
|
11020
11219
|
}
|
|
11021
|
-
return /* @__PURE__ */
|
|
11022
|
-
/* @__PURE__ */
|
|
11023
|
-
/* @__PURE__ */
|
|
11024
|
-
|
|
11220
|
+
return /* @__PURE__ */ jsxs18(ThemeProvider, { theme: banditTheme, children: [
|
|
11221
|
+
/* @__PURE__ */ jsx23(CssBaseline, {}),
|
|
11222
|
+
/* @__PURE__ */ jsxs18(
|
|
11223
|
+
Box20,
|
|
11025
11224
|
{
|
|
11026
11225
|
sx: (theme) => ({
|
|
11027
11226
|
display: "flex",
|
|
@@ -11050,7 +11249,7 @@ var ChatContent = () => {
|
|
|
11050
11249
|
transition: "left 0.3s ease-in-out, width 0.3s ease-in-out, transform 0.3s ease-in-out, border-radius 0.3s ease-in-out"
|
|
11051
11250
|
}),
|
|
11052
11251
|
children: [
|
|
11053
|
-
/* @__PURE__ */
|
|
11252
|
+
/* @__PURE__ */ jsx23(
|
|
11054
11253
|
chat_app_bar_default,
|
|
11055
11254
|
{
|
|
11056
11255
|
availableModels,
|
|
@@ -11064,9 +11263,9 @@ var ChatContent = () => {
|
|
|
11064
11263
|
onMobileConversationsOpenChange: setMobileConversationsOpen
|
|
11065
11264
|
}
|
|
11066
11265
|
),
|
|
11067
|
-
isTemporaryChat && /* @__PURE__ */
|
|
11068
|
-
/* @__PURE__ */
|
|
11069
|
-
|
|
11266
|
+
isTemporaryChat && /* @__PURE__ */ jsxs18(Fragment13, { children: [
|
|
11267
|
+
/* @__PURE__ */ jsx23(
|
|
11268
|
+
Box20,
|
|
11070
11269
|
{
|
|
11071
11270
|
sx: (theme) => ({
|
|
11072
11271
|
position: "absolute",
|
|
@@ -11078,8 +11277,8 @@ var ChatContent = () => {
|
|
|
11078
11277
|
})
|
|
11079
11278
|
}
|
|
11080
11279
|
),
|
|
11081
|
-
/* @__PURE__ */
|
|
11082
|
-
|
|
11280
|
+
/* @__PURE__ */ jsxs18(
|
|
11281
|
+
Box20,
|
|
11083
11282
|
{
|
|
11084
11283
|
sx: (theme) => ({
|
|
11085
11284
|
position: "absolute",
|
|
@@ -11103,10 +11302,10 @@ var ChatContent = () => {
|
|
|
11103
11302
|
whiteSpace: "nowrap"
|
|
11104
11303
|
}),
|
|
11105
11304
|
children: [
|
|
11106
|
-
/* @__PURE__ */
|
|
11305
|
+
/* @__PURE__ */ jsx23(Box20, { component: "span", "aria-hidden": true, sx: { fontSize: "0.9rem", lineHeight: 1 }, children: "\u{1F47B}" }),
|
|
11107
11306
|
"Temporary chat",
|
|
11108
|
-
/* @__PURE__ */
|
|
11109
|
-
|
|
11307
|
+
/* @__PURE__ */ jsx23(
|
|
11308
|
+
Box20,
|
|
11110
11309
|
{
|
|
11111
11310
|
component: "button",
|
|
11112
11311
|
type: "button",
|
|
@@ -11140,8 +11339,8 @@ var ChatContent = () => {
|
|
|
11140
11339
|
}
|
|
11141
11340
|
)
|
|
11142
11341
|
] }),
|
|
11143
|
-
/* @__PURE__ */
|
|
11144
|
-
|
|
11342
|
+
/* @__PURE__ */ jsx23(
|
|
11343
|
+
Box20,
|
|
11145
11344
|
{
|
|
11146
11345
|
ref: chatContainerRef,
|
|
11147
11346
|
sx: {
|
|
@@ -11161,8 +11360,8 @@ var ChatContent = () => {
|
|
|
11161
11360
|
msOverflowStyle: "none",
|
|
11162
11361
|
"&::-webkit-scrollbar": { display: "none" }
|
|
11163
11362
|
},
|
|
11164
|
-
children: /* @__PURE__ */
|
|
11165
|
-
|
|
11363
|
+
children: /* @__PURE__ */ jsxs18(
|
|
11364
|
+
Box20,
|
|
11166
11365
|
{
|
|
11167
11366
|
sx: {
|
|
11168
11367
|
width: "100%",
|
|
@@ -11175,8 +11374,8 @@ var ChatContent = () => {
|
|
|
11175
11374
|
logoShouldRender && !brandingLoading && (() => {
|
|
11176
11375
|
const headerMode = branding?.headerMode ?? "logo";
|
|
11177
11376
|
if (headerMode === "minimal") {
|
|
11178
|
-
return /* @__PURE__ */
|
|
11179
|
-
|
|
11377
|
+
return /* @__PURE__ */ jsx23(
|
|
11378
|
+
Box20,
|
|
11180
11379
|
{
|
|
11181
11380
|
sx: (theme) => ({
|
|
11182
11381
|
textAlign: "center",
|
|
@@ -11187,13 +11386,13 @@ var ChatContent = () => {
|
|
|
11187
11386
|
transition: "opacity 0.5s ease",
|
|
11188
11387
|
color: theme.palette.text.primary
|
|
11189
11388
|
}),
|
|
11190
|
-
children: /* @__PURE__ */
|
|
11389
|
+
children: /* @__PURE__ */ jsx23(Typography15, { sx: { fontWeight: 500, fontSize: { xs: "1.5rem", md: "1.9rem" }, lineHeight: 1.2 }, children: "What can I help with?" })
|
|
11191
11390
|
}
|
|
11192
11391
|
);
|
|
11193
11392
|
}
|
|
11194
11393
|
if (headerMode === "text") {
|
|
11195
|
-
return /* @__PURE__ */
|
|
11196
|
-
|
|
11394
|
+
return /* @__PURE__ */ jsx23(
|
|
11395
|
+
Box20,
|
|
11197
11396
|
{
|
|
11198
11397
|
sx: (theme) => ({
|
|
11199
11398
|
textAlign: "center",
|
|
@@ -11204,14 +11403,14 @@ var ChatContent = () => {
|
|
|
11204
11403
|
transition: "opacity 0.5s ease",
|
|
11205
11404
|
color: theme.palette.text.primary
|
|
11206
11405
|
}),
|
|
11207
|
-
children: /* @__PURE__ */
|
|
11406
|
+
children: /* @__PURE__ */ jsx23(Typography15, { sx: { fontWeight: 600, fontSize: { xs: "1.6rem", md: "2.1rem" }, lineHeight: 1.2 }, children: branding?.brandingText?.trim() || "Bandit AI" })
|
|
11208
11407
|
}
|
|
11209
11408
|
);
|
|
11210
11409
|
}
|
|
11211
|
-
return branding?.logoBase64 ? /* @__PURE__ */
|
|
11410
|
+
return branding?.logoBase64 ? /* @__PURE__ */ jsx23(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ jsx23(bandit_chat_logo_default, { visible: logoVisible, atTop: true });
|
|
11212
11411
|
})(),
|
|
11213
|
-
/* @__PURE__ */
|
|
11214
|
-
|
|
11412
|
+
/* @__PURE__ */ jsx23(
|
|
11413
|
+
Box20,
|
|
11215
11414
|
{
|
|
11216
11415
|
sx: {
|
|
11217
11416
|
margin: "0 auto",
|
|
@@ -11220,7 +11419,7 @@ var ChatContent = () => {
|
|
|
11220
11419
|
flexShrink: 0,
|
|
11221
11420
|
px: isMobile ? 0 : 0
|
|
11222
11421
|
},
|
|
11223
|
-
children: /* @__PURE__ */
|
|
11422
|
+
children: /* @__PURE__ */ jsx23(
|
|
11224
11423
|
chat_messages_default,
|
|
11225
11424
|
{
|
|
11226
11425
|
isStreaming,
|
|
@@ -11244,7 +11443,7 @@ var ChatContent = () => {
|
|
|
11244
11443
|
)
|
|
11245
11444
|
}
|
|
11246
11445
|
),
|
|
11247
|
-
showScrollToBottom && /* @__PURE__ */
|
|
11446
|
+
showScrollToBottom && /* @__PURE__ */ jsx23(
|
|
11248
11447
|
chat_scroll_to_bottom_button_default,
|
|
11249
11448
|
{
|
|
11250
11449
|
inputHeight,
|
|
@@ -11253,8 +11452,8 @@ var ChatContent = () => {
|
|
|
11253
11452
|
onClick: handleScrollToBottomClick
|
|
11254
11453
|
}
|
|
11255
11454
|
),
|
|
11256
|
-
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */
|
|
11257
|
-
|
|
11455
|
+
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ jsx23(
|
|
11456
|
+
Box20,
|
|
11258
11457
|
{
|
|
11259
11458
|
sx: (theme) => ({
|
|
11260
11459
|
position: "absolute",
|
|
@@ -11272,8 +11471,8 @@ var ChatContent = () => {
|
|
|
11272
11471
|
})
|
|
11273
11472
|
}
|
|
11274
11473
|
),
|
|
11275
|
-
/* @__PURE__ */
|
|
11276
|
-
|
|
11474
|
+
/* @__PURE__ */ jsxs18(
|
|
11475
|
+
Box20,
|
|
11277
11476
|
{
|
|
11278
11477
|
sx: {
|
|
11279
11478
|
display: "flex",
|
|
@@ -11284,11 +11483,11 @@ var ChatContent = () => {
|
|
|
11284
11483
|
maxWidth: "768px"
|
|
11285
11484
|
},
|
|
11286
11485
|
children: [
|
|
11287
|
-
/* @__PURE__ */
|
|
11288
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */
|
|
11289
|
-
/* @__PURE__ */
|
|
11290
|
-
/* @__PURE__ */
|
|
11291
|
-
/* @__PURE__ */
|
|
11486
|
+
/* @__PURE__ */ jsx23(Box20, { sx: { flex: "1 1 auto" } }),
|
|
11487
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ jsx23(Box20, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ jsx23(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
|
|
11488
|
+
/* @__PURE__ */ jsx23(rate_limit_prompt_default, {}),
|
|
11489
|
+
/* @__PURE__ */ jsx23(ask_user_card_default, {}),
|
|
11490
|
+
/* @__PURE__ */ jsx23(
|
|
11292
11491
|
chat_input_default,
|
|
11293
11492
|
{
|
|
11294
11493
|
inputValue,
|
|
@@ -11315,24 +11514,12 @@ var ChatContent = () => {
|
|
|
11315
11514
|
]
|
|
11316
11515
|
}
|
|
11317
11516
|
),
|
|
11318
|
-
preferences.feedbackEnabled &&
|
|
11319
|
-
|
|
11320
|
-
{
|
|
11321
|
-
fullScreen: false,
|
|
11322
|
-
zIndex: 1300,
|
|
11323
|
-
feedbackEmail: packageSettings?.feedbackEmail,
|
|
11324
|
-
absolute: true,
|
|
11325
|
-
position: {
|
|
11326
|
-
bottom: 20,
|
|
11327
|
-
right: 20
|
|
11328
|
-
}
|
|
11329
|
-
}
|
|
11330
|
-
),
|
|
11331
|
-
/* @__PURE__ */ jsx22(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
11517
|
+
preferences.feedbackEnabled && /* @__PURE__ */ jsx23(FeedbackPulse_default, { isMobile, feedbackEmail: packageSettings?.feedbackEmail }),
|
|
11518
|
+
/* @__PURE__ */ jsx23(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
11332
11519
|
]
|
|
11333
11520
|
}
|
|
11334
11521
|
),
|
|
11335
|
-
/* @__PURE__ */
|
|
11522
|
+
/* @__PURE__ */ jsx23(canvas_panel_default, { isMobile })
|
|
11336
11523
|
] });
|
|
11337
11524
|
};
|
|
11338
11525
|
var Chat = () => {
|
|
@@ -11358,13 +11545,13 @@ var Chat = () => {
|
|
|
11358
11545
|
});
|
|
11359
11546
|
if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
|
|
11360
11547
|
debugLogger.debug("User is not authenticated, redirecting to login");
|
|
11361
|
-
return /* @__PURE__ */
|
|
11548
|
+
return /* @__PURE__ */ jsx23(Navigate, { to: "/login", replace: true });
|
|
11362
11549
|
}
|
|
11363
|
-
return /* @__PURE__ */
|
|
11550
|
+
return /* @__PURE__ */ jsx23(ChatContent, {});
|
|
11364
11551
|
};
|
|
11365
11552
|
var chat_default = Chat;
|
|
11366
11553
|
|
|
11367
11554
|
export {
|
|
11368
11555
|
chat_default
|
|
11369
11556
|
};
|
|
11370
|
-
//# sourceMappingURL=chunk-
|
|
11557
|
+
//# sourceMappingURL=chunk-BVMTZTGQ.mjs.map
|