@burtson-labs/bandit-engine 2.0.135 → 2.0.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-PWESOU56.mjs";
3
+ } from "./chunk-YPIUO3IS.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-PU74BI6Y.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-A4AFGZMU.mjs";
13
+ } from "./chunk-2L5DC4OI.mjs";
14
14
  import "./chunk-BVYSGIWG.mjs";
15
15
  import "./chunk-F7JXIW6T.mjs";
16
16
  import "./chunk-K2JGFKEB.mjs";
@@ -21438,6 +21438,8 @@ ${sanitize(
21438
21438
  const hasFeedbackAction = isFeedbackEnabled && isMobile;
21439
21439
  const hasSttAction = isSTTAvailable && !isVoiceModeEnabled;
21440
21440
  const hasVoicePickerAction = isMobile && isTTSAvailable && availableVoices.length > 0;
21441
+ const hasComposeContent = !!inputValue.trim() || pastedImages.length > 0 || fileInputs.length > 0;
21442
+ const showSendButton = streamingActive || hasComposeContent || !isVoiceModeEligible;
21441
21443
  const hasSecondaryActions = isMobile && (hasAttachmentAction || hasMemoryAction || hasFeedbackAction || hasSttAction || hasVoicePickerAction);
21442
21444
  (0, import_react46.useEffect)(() => {
21443
21445
  if (!isMobile || !hasSecondaryActions) {
@@ -21502,6 +21504,33 @@ ${sanitize(
21502
21504
  if (!hasSttAction) return null;
21503
21505
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material39.Box, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(transcriber_default, { onTranscriptionCompleted: handleTranscriptionCompleted }) }, key ?? "stt");
21504
21506
  };
21507
+ const renderVoiceModeButton = (key) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21508
+ import_material39.Tooltip,
21509
+ {
21510
+ title: !isVoiceModeEnabled ? "Enable voice mode" : voiceStatus === "error" ? voiceError || "Voice mode error" : voiceStatus === "processing" ? "Transcribing your speech" : voiceStatus === "recording" ? "Recording - click to stop" : voiceStatus === "initializing" ? "Preparing microphone" : "Listening - click to turn off",
21511
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21512
+ import_material39.IconButton,
21513
+ {
21514
+ onClick: toggleVoiceMode,
21515
+ sx: {
21516
+ width: sendIconSize,
21517
+ height: sendIconSize,
21518
+ borderRadius: "50%",
21519
+ bgcolor: isVoiceModeEnabled ? (0, import_styles24.alpha)(theme.palette.error.main, theme.palette.mode === "dark" ? 0.45 : 0.3) : fileText,
21520
+ color: isVoiceModeEnabled ? theme.palette.common.white : fileIconBg,
21521
+ boxShadow: isVoiceModeEnabled && voiceStatus === "recording" ? `0 0 0 2px ${(0, import_styles24.alpha)(theme.palette.error.main, 0.25)}` : "none",
21522
+ transform: isVoiceModeEnabled && voiceStatus === "recording" ? "scale(1.05)" : "none",
21523
+ transition: "transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease",
21524
+ "&:hover": {
21525
+ bgcolor: isVoiceModeEnabled ? (0, import_styles24.alpha)(theme.palette.error.main, theme.palette.mode === "dark" ? 0.55 : 0.38) : hoverBadgeBackground
21526
+ }
21527
+ },
21528
+ children: !isVoiceModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GraphicEqIcon, { fontSize: "small" }) : voiceStatus === "processing" || voiceStatus === "initializing" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material39.CircularProgress, { size: 18, sx: { color: theme.palette.common.white } }) : voiceStatus === "error" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(HearingDisabledIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : voiceStatus === "recording" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.common.white } })
21529
+ }
21530
+ )
21531
+ },
21532
+ key ?? "voice-mode"
21533
+ );
21505
21534
  const renderVoicePickerButton = (key) => {
21506
21535
  if (!hasVoicePickerAction) return null;
21507
21536
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material39.Tooltip, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1] ?? selectedVoice) : "Default"}`, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
@@ -21749,51 +21778,22 @@ ${sanitize(
21749
21778
  minHeight: primaryIconSize
21750
21779
  },
21751
21780
  children: [
21752
- isVoiceModeEligible && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
21753
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21754
- import_material39.Tooltip,
21755
- {
21756
- title: !isVoiceModeEnabled ? "Enable voice mode" : voiceStatus === "error" ? voiceError || "Voice mode error" : voiceStatus === "processing" ? "Transcribing your speech" : voiceStatus === "recording" ? "Recording - click to stop" : voiceStatus === "initializing" ? "Preparing microphone" : "Listening - click to turn off",
21757
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21758
- import_material39.IconButton,
21759
- {
21760
- onClick: toggleVoiceMode,
21761
- sx: {
21762
- width: primaryIconSize,
21763
- height: primaryIconSize,
21764
- borderRadius: "50%",
21765
- bgcolor: isVoiceModeEnabled ? (0, import_styles24.alpha)(theme.palette.error.main, theme.palette.mode === "dark" ? 0.45 : 0.3) : badgeBackground,
21766
- color: isVoiceModeEnabled ? theme.palette.common.white : fileText,
21767
- boxShadow: isVoiceModeEnabled && voiceStatus === "recording" ? `0 0 0 2px ${(0, import_styles24.alpha)(theme.palette.error.main, 0.25)}` : "none",
21768
- transform: isVoiceModeEnabled && voiceStatus === "recording" ? "scale(1.05)" : "none",
21769
- transition: "transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease",
21770
- "&:hover": {
21771
- bgcolor: isVoiceModeEnabled ? (0, import_styles24.alpha)(theme.palette.error.main, theme.palette.mode === "dark" ? 0.55 : 0.38) : hoverBadgeBackground
21772
- }
21773
- },
21774
- children: !isVoiceModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.mode === "dark" ? fileText : theme.palette.text.secondary } }) : voiceStatus === "processing" || voiceStatus === "initializing" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material39.CircularProgress, { size: 18, sx: { color: fileText } }) : voiceStatus === "error" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(HearingDisabledIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : voiceStatus === "recording" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.common.white } })
21775
- }
21776
- )
21777
- }
21778
- ),
21779
- !isMobile && isVoiceModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21780
- import_material39.Typography,
21781
- {
21782
- variant: "caption",
21783
- sx: {
21784
- color: voiceStatus === "error" ? theme.palette.error.main : voiceStatus === "processing" ? theme.palette.warning.main : fileText,
21785
- maxWidth: 240,
21786
- overflow: "hidden",
21787
- textOverflow: "ellipsis",
21788
- whiteSpace: "nowrap"
21789
- },
21790
- children: voiceStatus === "error" ? voiceError || "Voice mode unavailable" : voiceStatus === "initializing" ? "Starting voice mode..." : voiceStatus === "recording" ? "Recording..." : voiceStatus === "processing" ? "Transcribing..." : voiceLastTranscript ? `Heard: "${voiceLastTranscript.length > 60 ? `${voiceLastTranscript.slice(0, 57)}...` : voiceLastTranscript}"` : "Listening..."
21791
- }
21792
- )
21793
- ] }),
21794
21781
  !isMobile && renderAttachmentButton("attach-inline"),
21795
21782
  !isMobile && renderMemoryButton("memory-inline"),
21796
- !isMobile && renderSttButton("stt-inline"),
21783
+ !isMobile && isVoiceModeEligible && isVoiceModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21784
+ import_material39.Typography,
21785
+ {
21786
+ variant: "caption",
21787
+ sx: {
21788
+ color: voiceStatus === "error" ? theme.palette.error.main : voiceStatus === "processing" ? theme.palette.warning.main : fileText,
21789
+ maxWidth: 240,
21790
+ overflow: "hidden",
21791
+ textOverflow: "ellipsis",
21792
+ whiteSpace: "nowrap"
21793
+ },
21794
+ children: voiceStatus === "error" ? voiceError || "Voice mode unavailable" : voiceStatus === "initializing" ? "Starting voice mode..." : voiceStatus === "recording" ? "Recording..." : voiceStatus === "processing" ? "Transcribing..." : voiceLastTranscript ? `Heard: "${voiceLastTranscript.length > 60 ? `${voiceLastTranscript.slice(0, 57)}...` : voiceLastTranscript}"` : "Listening..."
21795
+ }
21796
+ ),
21797
21797
  isMobile && hasSecondaryActions && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21798
21798
  import_material39.IconButton,
21799
21799
  {
@@ -21849,7 +21849,9 @@ ${sanitize(
21849
21849
  ),
21850
21850
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_material39.Box, { sx: { display: "flex", alignItems: "center", gap: isMobile ? 0.6 : 1 }, children: [
21851
21851
  !isMobile && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(engine_picker_default, {}),
21852
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material39.Tooltip, { title: isStreaming ? "Stop response" : "Send message", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21852
+ !isMobile && renderSttButton("stt-right"),
21853
+ isVoiceModeEligible && !showSendButton && renderVoiceModeButton("voice-right"),
21854
+ showSendButton && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material39.Tooltip, { title: isStreaming ? "Stop response" : "Send message", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
21853
21855
  import_material39.IconButton,
21854
21856
  {
21855
21857
  onClick: isStreaming ? onStop || (() => {
@@ -31245,10 +31247,13 @@ var init_chat2 = __esm({
31245
31247
  // Claude iOS, where the card runs edge-to-edge vertically and the
31246
31248
  // hairline border keeps the corners legible. Width kept in sync
31247
31249
  // with the drawer in enhanced-mobile-conversations-modal.tsx.
31248
- // Claude iOS geometry: the card drops DOWN by the status-bar inset,
31249
- // so its big rounded top corners are visible below the clock while
31250
- // its bottom slides past the screen edge — no hard bottom line.
31251
- transform: isMobile && mobileConversationsOpen ? "translateX(min(calc(100vw - 56px), 360px)) translateY(calc(max(env(safe-area-inset-top, 0px), 20px) + 12px))" : "none",
31250
+ // iOS-sheet recede (Claude style): the card scales down anchored at
31251
+ // its bottom-left, so the rounded top corners appear inset below the
31252
+ // status area, the bottom stays flush with the screen edge, and the
31253
+ // motion reads as the native sheet-behind effect instead of the
31254
+ // content lurching downward.
31255
+ transform: isMobile && mobileConversationsOpen ? "translateX(min(calc(100vw - 56px), 360px)) scale(0.93)" : "none",
31256
+ transformOrigin: "left bottom",
31252
31257
  borderRadius: isMobile && mobileConversationsOpen ? "36px" : 0,
31253
31258
  // Hairline border so the rounded card reads even when the backdrop
31254
31259
  // is the same near-black as the shell.
@@ -31278,7 +31283,7 @@ var init_chat2 = __esm({
31278
31283
  sx: (theme) => ({
31279
31284
  position: "absolute",
31280
31285
  inset: isMobile ? "3px" : 0,
31281
- border: `2px solid ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.35)" : "rgba(0,0,0,0.3)"}`,
31286
+ border: `3px solid ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.55)" : "rgba(0,0,0,0.45)"}`,
31282
31287
  borderRadius: isMobile ? "28px" : "inherit",
31283
31288
  zIndex: 1400,
31284
31289
  pointerEvents: "none"