@burtson-labs/bandit-engine 2.0.90 → 2.0.92

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
@@ -15412,83 +15412,134 @@ var init_source_chips = __esm({
15412
15412
  const [failed, setFailed] = (0, import_react18.useState)(false);
15413
15413
  const domain = domainOf(source.url);
15414
15414
  const label = source.title?.trim() || domain;
15415
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material11.Tooltip, { title: `${label} \xB7 ${domain}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
15416
- import_material11.Box,
15415
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15416
+ import_material11.Tooltip,
15417
15417
  {
15418
- component: "a",
15419
- href: source.url,
15420
- target: "_blank",
15421
- rel: "noopener noreferrer",
15422
- sx: {
15423
- display: "inline-flex",
15424
- alignItems: "center",
15425
- gap: 0.75,
15426
- maxWidth: 240,
15427
- px: 1,
15428
- py: 0.4,
15429
- borderRadius: 999,
15430
- border: "1px solid",
15431
- borderColor: "divider",
15432
- bgcolor: "action.hover",
15433
- textDecoration: "none",
15434
- color: "text.primary",
15435
- fontSize: 12.5,
15436
- lineHeight: 1.4,
15437
- transition: "border-color 0.15s ease, background-color 0.15s ease",
15438
- "&:hover": { borderColor: "primary.main", bgcolor: "action.selected" }
15439
- },
15440
- children: [
15441
- failed ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15442
- import_material11.Box,
15443
- {
15444
- sx: {
15445
- width: 16,
15446
- height: 16,
15447
- borderRadius: "4px",
15448
- bgcolor: "primary.main",
15449
- color: "primary.contrastText",
15450
- display: "grid",
15451
- placeItems: "center",
15452
- fontSize: 9,
15453
- fontWeight: 700,
15454
- flexShrink: 0
15455
- },
15456
- children: domain.charAt(0).toUpperCase()
15457
- }
15458
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15459
- import_material11.Box,
15460
- {
15461
- component: "img",
15462
- src: `https://icons.duckduckgo.com/ip3/${domain}.ico`,
15463
- alt: "",
15464
- loading: "lazy",
15465
- onError: () => setFailed(true),
15466
- sx: { width: 16, height: 16, borderRadius: "4px", flexShrink: 0 }
15467
- }
15468
- ),
15469
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15470
- import_material11.Box,
15471
- {
15472
- component: "span",
15473
- sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
15474
- children: label
15475
- }
15476
- )
15477
- ]
15418
+ title: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
15419
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material11.Box, { sx: { fontWeight: 600 }, children: label }),
15420
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material11.Box, { sx: { opacity: 0.75, fontSize: 11, wordBreak: "break-all", mt: 0.25 }, children: source.url })
15421
+ ] }),
15422
+ arrow: true,
15423
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
15424
+ import_material11.Box,
15425
+ {
15426
+ component: "a",
15427
+ href: source.url,
15428
+ target: "_blank",
15429
+ rel: "noopener noreferrer",
15430
+ className: "source-chip",
15431
+ sx: {
15432
+ display: "inline-flex",
15433
+ alignItems: "center",
15434
+ flexShrink: 0,
15435
+ height: 26,
15436
+ px: 0.4,
15437
+ borderRadius: 999,
15438
+ border: "1px solid",
15439
+ borderColor: "divider",
15440
+ bgcolor: "background.paper",
15441
+ textDecoration: "none",
15442
+ color: "text.primary",
15443
+ fontSize: 12.5,
15444
+ lineHeight: 1.4,
15445
+ transition: "border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease",
15446
+ "&:hover": { borderColor: "primary.main", bgcolor: "action.hover", boxShadow: 1, zIndex: 2 }
15447
+ },
15448
+ children: [
15449
+ failed ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15450
+ import_material11.Box,
15451
+ {
15452
+ sx: {
15453
+ width: 18,
15454
+ height: 18,
15455
+ borderRadius: "50%",
15456
+ bgcolor: "primary.main",
15457
+ color: "primary.contrastText",
15458
+ display: "grid",
15459
+ placeItems: "center",
15460
+ fontSize: 9,
15461
+ fontWeight: 700,
15462
+ flexShrink: 0
15463
+ },
15464
+ children: domain.charAt(0).toUpperCase()
15465
+ }
15466
+ ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15467
+ import_material11.Box,
15468
+ {
15469
+ component: "img",
15470
+ src: `https://icons.duckduckgo.com/ip3/${domain}.ico`,
15471
+ alt: "",
15472
+ loading: "lazy",
15473
+ onError: () => setFailed(true),
15474
+ sx: { width: 18, height: 18, borderRadius: "50%", flexShrink: 0 }
15475
+ }
15476
+ ),
15477
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15478
+ import_material11.Box,
15479
+ {
15480
+ className: "chip-label",
15481
+ component: "span",
15482
+ sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
15483
+ children: label
15484
+ }
15485
+ )
15486
+ ]
15487
+ }
15488
+ )
15478
15489
  }
15479
- ) });
15490
+ );
15480
15491
  };
15481
15492
  SourceChips = ({ content }) => {
15482
15493
  const sources = (0, import_react18.useMemo)(() => parseWebSources(content), [content]);
15483
15494
  if (sources.length === 0) return null;
15484
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15485
- import_material11.Box,
15486
- {
15487
- sx: { display: "flex", flexWrap: "wrap", gap: 0.75, mt: 1.5 },
15488
- "aria-label": "Sources",
15489
- children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SourceChip, { source: s }, `${s.url}-${i}`))
15490
- }
15491
- );
15495
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material11.Box, { sx: { display: "flex", alignItems: "center", gap: 0.75, mt: 1.5, flexWrap: "wrap" }, "aria-label": "Sources", children: [
15496
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15497
+ import_material11.Box,
15498
+ {
15499
+ component: "span",
15500
+ sx: {
15501
+ fontSize: 11,
15502
+ fontWeight: 700,
15503
+ color: "text.secondary",
15504
+ textTransform: "uppercase",
15505
+ letterSpacing: 0.5,
15506
+ flexShrink: 0
15507
+ },
15508
+ children: "Sources"
15509
+ }
15510
+ ),
15511
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15512
+ import_material11.Box,
15513
+ {
15514
+ sx: {
15515
+ display: "flex",
15516
+ alignItems: "center",
15517
+ flexWrap: "wrap",
15518
+ rowGap: 0.5,
15519
+ // Touch / no-hover devices: chips stay expanded (no hover to reveal).
15520
+ "& .source-chip": { ml: "4px" },
15521
+ "& .source-chip:first-of-type": { ml: 0 },
15522
+ "& .chip-label": { maxWidth: 200, opacity: 1, ml: 0.6 },
15523
+ // Hover-capable devices: collapse into an overlapping favicon stack
15524
+ // that spreads out and reveals titles when the rail is hovered.
15525
+ "@media (hover: hover)": {
15526
+ "& .source-chip": { ml: "-10px", transition: "margin-left 0.22s ease" },
15527
+ "& .source-chip:first-of-type": { ml: 0 },
15528
+ "& .chip-label": {
15529
+ maxWidth: 0,
15530
+ opacity: 0,
15531
+ ml: 0,
15532
+ transition: "max-width 0.28s ease, opacity 0.18s ease, margin-left 0.2s ease"
15533
+ },
15534
+ "&:hover .source-chip": { ml: "6px" },
15535
+ "&:hover .source-chip:first-of-type": { ml: 0 },
15536
+ "&:hover .chip-label": { maxWidth: 200, opacity: 1, ml: 0.6 }
15537
+ }
15538
+ },
15539
+ children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SourceChip, { source: s }, `${s.url}-${i}`))
15540
+ }
15541
+ )
15542
+ ] });
15492
15543
  };
15493
15544
  source_chips_default = SourceChips;
15494
15545
  }
@@ -15598,7 +15649,7 @@ var init_chat_messages = __esm({
15598
15649
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15599
15650
  StreamingMarkdown_default,
15600
15651
  {
15601
- content: isStreaming && isLast ? content : stripSourcesForDisplay(content),
15652
+ content: stripSourcesForDisplay(content),
15602
15653
  isStreaming: isStreaming && isLast,
15603
15654
  sources: sourceSummaries
15604
15655
  }