@burtson-labs/bandit-engine 2.0.90 → 2.0.93

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,103 @@ 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
+ sx: {
15431
+ display: "inline-flex",
15432
+ alignItems: "center",
15433
+ flexShrink: 0,
15434
+ gap: 0.5,
15435
+ height: 26,
15436
+ px: 0.75,
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
+ component: "span",
15481
+ sx: { maxWidth: 150, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
15482
+ children: label
15483
+ }
15484
+ )
15485
+ ]
15486
+ }
15487
+ )
15478
15488
  }
15479
- ) });
15489
+ );
15480
15490
  };
15481
15491
  SourceChips = ({ content }) => {
15482
15492
  const sources = (0, import_react18.useMemo)(() => parseWebSources(content), [content]);
15483
15493
  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
- );
15494
+ 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: [
15495
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15496
+ import_material11.Box,
15497
+ {
15498
+ component: "span",
15499
+ sx: {
15500
+ fontSize: 11,
15501
+ fontWeight: 700,
15502
+ color: "text.secondary",
15503
+ textTransform: "uppercase",
15504
+ letterSpacing: 0.5,
15505
+ flexShrink: 0
15506
+ },
15507
+ children: "Sources"
15508
+ }
15509
+ ),
15510
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material11.Box, { sx: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 0.75 }, children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SourceChip, { source: s }, `${s.url}-${i}`)) })
15511
+ ] });
15492
15512
  };
15493
15513
  source_chips_default = SourceChips;
15494
15514
  }
@@ -15598,7 +15618,7 @@ var init_chat_messages = __esm({
15598
15618
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15599
15619
  StreamingMarkdown_default,
15600
15620
  {
15601
- content: isStreaming && isLast ? content : stripSourcesForDisplay(content),
15621
+ content: stripSourcesForDisplay(content),
15602
15622
  isStreaming: isStreaming && isLast,
15603
15623
  sources: sourceSummaries
15604
15624
  }