@burtson-labs/bandit-engine 2.0.130 → 2.0.132

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.js CHANGED
@@ -15755,7 +15755,7 @@ var init_source_chips = __esm({
15755
15755
  });
15756
15756
 
15757
15757
  // src/chat/chat-messages.tsx
15758
- var import_material12, import_jsx_runtime15, WORKING_TOKEN_RE, ToolWorkingChip, ChatMessages, chat_messages_default;
15758
+ var import_material12, import_jsx_runtime15, WORKING_TOKEN_RE, BYTE_TOKEN_RUN_RE, decodeByteTokens, ToolWorkingChip, ChatMessages, chat_messages_default;
15759
15759
  var init_chat_messages = __esm({
15760
15760
  "src/chat/chat-messages.tsx"() {
15761
15761
  "use strict";
@@ -15766,6 +15766,18 @@ var init_chat_messages = __esm({
15766
15766
  init_conversationStore();
15767
15767
  import_jsx_runtime15 = require("react/jsx-runtime");
15768
15768
  WORKING_TOKEN_RE = /\s*<<working:([^>]*)>>\s*$/;
15769
+ BYTE_TOKEN_RUN_RE = /(?:<0x[0-9A-Fa-f]{2}>)+/g;
15770
+ decodeByteTokens = (text) => {
15771
+ if (!text || text.indexOf("<0x") === -1) return text;
15772
+ return text.replace(BYTE_TOKEN_RUN_RE, (run) => {
15773
+ const bytes = Array.from(run.matchAll(/<0x([0-9A-Fa-f]{2})>/g), (m) => parseInt(m[1], 16));
15774
+ try {
15775
+ return new TextDecoder("utf-8", { fatal: true }).decode(new Uint8Array(bytes));
15776
+ } catch {
15777
+ return "";
15778
+ }
15779
+ });
15780
+ };
15769
15781
  ToolWorkingChip = ({ label }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
15770
15782
  import_material12.Box,
15771
15783
  {
@@ -15816,7 +15828,7 @@ var init_chat_messages = __esm({
15816
15828
  const lastIndex = history.length - 1;
15817
15829
  const hasActivePlaceholder = lastIndex >= 0 && history[lastIndex]?.answer === "...";
15818
15830
  if (!responseStarted && !pendingMessage && history.length === 0) return null;
15819
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_material12.Box, { sx: { px: isMobile ? 0 : 0, pt: "100px", display: "flex", flexDirection: "column", gap: 2 }, children: [
15831
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_material12.Box, { sx: { px: isMobile ? 0 : 0, pt: "calc(100px + env(safe-area-inset-top, 0px))", display: "flex", flexDirection: "column", gap: 2 }, children: [
15820
15832
  history.map((entry, index) => {
15821
15833
  const isLast = index === lastIndex;
15822
15834
  const isPlaceholder = entry.answer === "...";
@@ -15824,7 +15836,9 @@ var init_chat_messages = __esm({
15824
15836
  const showThinking = showLoader && isThinking;
15825
15837
  const rawContent = isLast ? isStreaming ? streamBuffer || "" : isPlaceholder ? "" : entry.answer : entry.answer;
15826
15838
  const workingMatch = isLast && isStreaming ? rawContent.match(WORKING_TOKEN_RE) : null;
15827
- const content = workingMatch ? rawContent.replace(WORKING_TOKEN_RE, "") : rawContent;
15839
+ const content = decodeByteTokens(
15840
+ workingMatch ? rawContent.replace(WORKING_TOKEN_RE, "") : rawContent
15841
+ );
15828
15842
  const rawSources = entry.sourceFiles;
15829
15843
  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;
15830
15844
  const responseNode = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
@@ -26023,7 +26037,10 @@ var init_enhanced_mobile_conversations_modal = __esm({
26023
26037
  display: "flex",
26024
26038
  flexDirection: "column",
26025
26039
  overflow: "hidden",
26026
- outline: "none"
26040
+ outline: "none",
26041
+ // Edge-to-edge PWA: the drawer surface runs under the status
26042
+ // bar (like Claude); its content starts below it.
26043
+ pt: "env(safe-area-inset-top, 0px)"
26027
26044
  },
26028
26045
  children: [
26029
26046
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
@@ -26912,6 +26929,8 @@ var init_chat_app_bar = __esm({
26912
26929
  width: "100%",
26913
26930
  px: 2,
26914
26931
  py: 1,
26932
+ // Edge-to-edge PWA: keep the pills below the status bar / notch.
26933
+ pt: "calc(8px + env(safe-area-inset-top, 0px))",
26915
26934
  display: "flex",
26916
26935
  alignItems: "center",
26917
26936
  justifyContent: "space-between",
@@ -30089,7 +30108,7 @@ var init_FeedbackPulse = __esm({
30089
30108
  recordInteraction("dismissed");
30090
30109
  setVisible(false);
30091
30110
  };
30092
- const choice = (emoji, label, outcome) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
30111
+ const choice = (icon, label, outcome) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
30093
30112
  import_material31.Box,
30094
30113
  {
30095
30114
  component: "button",
@@ -30116,7 +30135,7 @@ var init_FeedbackPulse = __esm({
30116
30135
  "&:active": { transform: "scale(0.96)" }
30117
30136
  },
30118
30137
  children: [
30119
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { component: "span", sx: { fontSize: "1.3rem", lineHeight: 1 }, children: emoji }),
30138
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { component: "span", sx: { display: "inline-flex", lineHeight: 1 }, children: icon }),
30120
30139
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "caption", sx: { fontWeight: 600 }, children: label })
30121
30140
  ]
30122
30141
  }
@@ -30141,15 +30160,15 @@ var init_FeedbackPulse = __esm({
30141
30160
  bgcolor: theme.palette.background.paper,
30142
30161
  boxShadow: `0 12px 40px ${(0, import_styles32.alpha)(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
30143
30162
  },
30144
- children: thanked ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback! \u{1F64C}" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
30163
+ children: thanked ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
30145
30164
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { sx: { display: "flex", alignItems: "center", mb: 0.5 }, children: [
30146
30165
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: "How's Bandit doing?" }),
30147
30166
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react14.X, { size: 16 }) })
30148
30167
  ] }),
30149
30168
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { sx: { display: "flex", justifyContent: "space-evenly" }, children: [
30150
- choice("\u{1F60A}", "Good", "good"),
30151
- choice("\u{1F610}", "Fine", "fine"),
30152
- choice("\u{1F641}", "Bad", "bad")
30169
+ choice(/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react14.Smile, { size: 22, color: theme.palette.success.main }), "Good", "good"),
30170
+ choice(/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react14.Meh, { size: 22, color: theme.palette.warning.main }), "Fine", "fine"),
30171
+ choice(/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react14.Frown, { size: 22, color: theme.palette.error.main }), "Bad", "bad")
30153
30172
  ] })
30154
30173
  ] })
30155
30174
  }
@@ -30587,7 +30606,7 @@ var chat_exports = {};
30587
30606
  __export(chat_exports, {
30588
30607
  default: () => chat_default
30589
30608
  });
30590
- var import_react41, import_material33, import_styles33, import_react_router_dom4, import_jsx_runtime34, ChatContent, Chat, chat_default;
30609
+ var import_react41, import_material33, import_styles33, import_react_router_dom4, import_lucide_react15, import_jsx_runtime34, ChatContent, Chat, chat_default;
30591
30610
  var init_chat2 = __esm({
30592
30611
  "src/chat/chat.tsx"() {
30593
30612
  "use strict";
@@ -30633,6 +30652,7 @@ var init_chat2 = __esm({
30633
30652
  init_voiceModeStore();
30634
30653
  init_ttsSanitizer();
30635
30654
  init_FeatureFlagContext();
30655
+ import_lucide_react15 = require("lucide-react");
30636
30656
  import_jsx_runtime34 = require("react/jsx-runtime");
30637
30657
  ChatContent = () => {
30638
30658
  const packageSettings = usePackageSettingsStore((state) => state.settings);
@@ -31668,7 +31688,7 @@ var init_chat2 = __esm({
31668
31688
  whiteSpace: "nowrap"
31669
31689
  }),
31670
31690
  children: [
31671
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material33.Box, { component: "span", "aria-hidden": true, sx: { fontSize: "0.9rem", lineHeight: 1 }, children: "\u{1F47B}" }),
31691
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react15.Ghost, { size: 14, "aria-hidden": true }),
31672
31692
  "Temporary chat",
31673
31693
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
31674
31694
  import_material33.Box,
@@ -34371,7 +34391,7 @@ var generic_loader_default = GenericLoader;
34371
34391
  // src/components/feedback/FeedbackButton.tsx
34372
34392
  var import_react46 = require("react");
34373
34393
  var import_material39 = require("@mui/material");
34374
- var import_lucide_react15 = require("lucide-react");
34394
+ var import_lucide_react16 = require("lucide-react");
34375
34395
 
34376
34396
  // src/components/feedback/index.tsx
34377
34397
  init_FeedbackModal();
@@ -34399,7 +34419,7 @@ var FeedbackButton = ({
34399
34419
  import_material39.Button,
34400
34420
  {
34401
34421
  variant: "outlined",
34402
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react15.MessageCircle, {}),
34422
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.MessageCircle, {}),
34403
34423
  onClick: handleOpen,
34404
34424
  className,
34405
34425
  size,
@@ -34428,7 +34448,7 @@ var FeedbackButton = ({
34428
34448
  transform: "translateY(-1px)"
34429
34449
  }
34430
34450
  },
34431
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react15.MessageCircle, {})
34451
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.MessageCircle, {})
34432
34452
  }
34433
34453
  ) }),
34434
34454
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
@@ -34487,7 +34507,7 @@ var FeedbackButton = ({
34487
34507
  }
34488
34508
  }
34489
34509
  },
34490
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react15.MessageCircle, {})
34510
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.MessageCircle, {})
34491
34511
  }
34492
34512
  )
34493
34513
  }
@@ -37321,7 +37341,12 @@ var PreferencesTab = ({
37321
37341
  const timeoutRef = (0, import_react53.useRef)(null);
37322
37342
  const fileInputRef = (0, import_react53.useRef)(null);
37323
37343
  const { exportPreferences, importPreferences, resetToDefaults } = usePreferencesStore();
37324
- const { isServiceAvailable: isTTSSTTAvailable } = useVoiceStore();
37344
+ const {
37345
+ isServiceAvailable: isTTSSTTAvailable,
37346
+ availableVoices,
37347
+ selectedVoice,
37348
+ setSelectedVoice
37349
+ } = useVoiceStore();
37325
37350
  const { hasAdvancedSearch, hasAdvancedMemories } = useFeatures();
37326
37351
  const {
37327
37352
  initialized: syncInitialized,
@@ -37941,6 +37966,19 @@ var PreferencesTab = ({
37941
37966
  ] })
37942
37967
  }
37943
37968
  ),
37969
+ preferences.ttsEnabled && isTTSSTTAvailable && availableVoices.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.FormControl, { size: "small", sx: { ml: 6, mt: 1, maxWidth: 280 }, children: [
37970
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.InputLabel, { id: "tts-voice-label", children: "Voice" }),
37971
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
37972
+ import_material44.Select,
37973
+ {
37974
+ labelId: "tts-voice-label",
37975
+ label: "Voice",
37976
+ value: availableVoices.includes(selectedVoice) ? selectedVoice : "",
37977
+ onChange: (e) => setSelectedVoice(e.target.value),
37978
+ children: availableVoices.map((voice) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.MenuItem, { value: voice, children: voice.split("-")[1] ? voice.split("-")[1].charAt(0).toUpperCase() + voice.split("-")[1].slice(1) : voice }, voice))
37979
+ }
37980
+ )
37981
+ ] }),
37944
37982
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
37945
37983
  import_material44.FormControlLabel,
37946
37984
  {
@@ -39330,7 +39368,7 @@ init_useFeatures();
39330
39368
  // src/components/shared/ProcessingOverlay.tsx
39331
39369
  var import_react56 = require("react");
39332
39370
  var import_material47 = require("@mui/material");
39333
- var import_lucide_react16 = require("lucide-react");
39371
+ var import_lucide_react17 = require("lucide-react");
39334
39372
  var import_jsx_runtime47 = require("react/jsx-runtime");
39335
39373
  var ninjaFloat = import_material47.keyframes`
39336
39374
  0%, 100% { transform: translateY(0px) rotate(0deg); }
@@ -39355,28 +39393,28 @@ var defaultSteps = [
39355
39393
  id: "upload",
39356
39394
  title: "Uploading to Cloud",
39357
39395
  description: "Our digital ninjas are securely transferring your file...",
39358
- icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.CloudUpload, {}),
39396
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react17.CloudUpload, {}),
39359
39397
  duration: 5
39360
39398
  },
39361
39399
  {
39362
39400
  id: "analyze",
39363
39401
  title: "AI Analysis",
39364
39402
  description: "Advanced AI robots are reading and understanding your content...",
39365
- icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Brain, {}),
39403
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react17.Brain, {}),
39366
39404
  duration: 15
39367
39405
  },
39368
39406
  {
39369
39407
  id: "embed",
39370
39408
  title: "Making It Searchable",
39371
39409
  description: "We turn the content into a private, searchable index...",
39372
- icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Cpu, {}),
39410
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react17.Cpu, {}),
39373
39411
  duration: 10
39374
39412
  },
39375
39413
  {
39376
39414
  id: "optimize",
39377
39415
  title: "Optimizing Search",
39378
39416
  description: "Organizing everything for quick, reliable answers...",
39379
- icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Sparkles, {}),
39417
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react17.Sparkles, {}),
39380
39418
  duration: 8
39381
39419
  }
39382
39420
  ];
@@ -39522,7 +39560,7 @@ var ProcessingOverlay = ({
39522
39560
  animation: `${pulse} 3s ease-in-out infinite`,
39523
39561
  color: theme.palette.secondary.main
39524
39562
  },
39525
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Bot, {})
39563
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react17.Bot, {})
39526
39564
  }
39527
39565
  ),
39528
39566
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
@@ -39536,7 +39574,7 @@ var ProcessingOverlay = ({
39536
39574
  color: theme.palette.primary.main,
39537
39575
  animationDelay: "1s"
39538
39576
  },
39539
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react16.Zap, {})
39577
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react17.Zap, {})
39540
39578
  }
39541
39579
  )
39542
39580
  ] }),
@@ -46538,7 +46576,7 @@ init_streaming_tts();
46538
46576
 
46539
46577
  // src/modals/SubscriptionExpiredModal.tsx
46540
46578
  var import_material57 = require("@mui/material");
46541
- var import_lucide_react17 = require("lucide-react");
46579
+ var import_lucide_react18 = require("lucide-react");
46542
46580
  var import_jsx_runtime57 = require("react/jsx-runtime");
46543
46581
  var SubscriptionExpiredModal = ({
46544
46582
  open,
@@ -46577,7 +46615,7 @@ var SubscriptionExpiredModal = ({
46577
46615
  },
46578
46616
  children: [
46579
46617
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_material57.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_material57.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
46580
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react17.AlertTriangle, { size: 32, color: "warning" }),
46618
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react18.AlertTriangle, { size: 32, color: "warning" }),
46581
46619
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_material57.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
46582
46620
  ] }) }),
46583
46621
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_material57.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_material57.Stack, { spacing: 2, children: [
@@ -46605,7 +46643,7 @@ var SubscriptionExpiredModal = ({
46605
46643
  {
46606
46644
  onClick: handleNavigateHome,
46607
46645
  variant: "outlined",
46608
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react17.Home, {}),
46646
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react18.Home, {}),
46609
46647
  size: "large",
46610
46648
  sx: { minWidth: 140 },
46611
46649
  children: "Go Home"
@@ -46616,7 +46654,7 @@ var SubscriptionExpiredModal = ({
46616
46654
  {
46617
46655
  onClick: handleManageSubscription,
46618
46656
  variant: "contained",
46619
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react17.CreditCard, {}),
46657
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react18.CreditCard, {}),
46620
46658
  size: "large",
46621
46659
  color: "primary",
46622
46660
  sx: { minWidth: 140 },