@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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-42X7ZU6O.mjs";
3
+ } from "./chunk-JJNPBLJ7.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-OSSZ7Z2O.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-ZOUKYB66.mjs";
13
+ } from "./chunk-AS6WS4H2.mjs";
14
14
  import "./chunk-RUMVTVNM.mjs";
15
15
  import "./chunk-ZLXWNTFK.mjs";
16
16
  import "./chunk-L2EKYO4F.mjs";
@@ -20389,83 +20389,134 @@ var init_source_chips = __esm({
20389
20389
  const [failed, setFailed] = (0, import_react43.useState)(false);
20390
20390
  const domain = domainOf(source.url);
20391
20391
  const label = source.title?.trim() || domain;
20392
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material35.Tooltip, { title: `${label} \xB7 ${domain}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
20393
- import_material35.Box,
20392
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20393
+ import_material35.Tooltip,
20394
20394
  {
20395
- component: "a",
20396
- href: source.url,
20397
- target: "_blank",
20398
- rel: "noopener noreferrer",
20399
- sx: {
20400
- display: "inline-flex",
20401
- alignItems: "center",
20402
- gap: 0.75,
20403
- maxWidth: 240,
20404
- px: 1,
20405
- py: 0.4,
20406
- borderRadius: 999,
20407
- border: "1px solid",
20408
- borderColor: "divider",
20409
- bgcolor: "action.hover",
20410
- textDecoration: "none",
20411
- color: "text.primary",
20412
- fontSize: 12.5,
20413
- lineHeight: 1.4,
20414
- transition: "border-color 0.15s ease, background-color 0.15s ease",
20415
- "&:hover": { borderColor: "primary.main", bgcolor: "action.selected" }
20416
- },
20417
- children: [
20418
- failed ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20419
- import_material35.Box,
20420
- {
20421
- sx: {
20422
- width: 16,
20423
- height: 16,
20424
- borderRadius: "4px",
20425
- bgcolor: "primary.main",
20426
- color: "primary.contrastText",
20427
- display: "grid",
20428
- placeItems: "center",
20429
- fontSize: 9,
20430
- fontWeight: 700,
20431
- flexShrink: 0
20432
- },
20433
- children: domain.charAt(0).toUpperCase()
20434
- }
20435
- ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20436
- import_material35.Box,
20437
- {
20438
- component: "img",
20439
- src: `https://icons.duckduckgo.com/ip3/${domain}.ico`,
20440
- alt: "",
20441
- loading: "lazy",
20442
- onError: () => setFailed(true),
20443
- sx: { width: 16, height: 16, borderRadius: "4px", flexShrink: 0 }
20444
- }
20445
- ),
20446
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20447
- import_material35.Box,
20448
- {
20449
- component: "span",
20450
- sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
20451
- children: label
20452
- }
20453
- )
20454
- ]
20395
+ title: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
20396
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material35.Box, { sx: { fontWeight: 600 }, children: label }),
20397
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material35.Box, { sx: { opacity: 0.75, fontSize: 11, wordBreak: "break-all", mt: 0.25 }, children: source.url })
20398
+ ] }),
20399
+ arrow: true,
20400
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
20401
+ import_material35.Box,
20402
+ {
20403
+ component: "a",
20404
+ href: source.url,
20405
+ target: "_blank",
20406
+ rel: "noopener noreferrer",
20407
+ className: "source-chip",
20408
+ sx: {
20409
+ display: "inline-flex",
20410
+ alignItems: "center",
20411
+ flexShrink: 0,
20412
+ height: 26,
20413
+ px: 0.4,
20414
+ borderRadius: 999,
20415
+ border: "1px solid",
20416
+ borderColor: "divider",
20417
+ bgcolor: "background.paper",
20418
+ textDecoration: "none",
20419
+ color: "text.primary",
20420
+ fontSize: 12.5,
20421
+ lineHeight: 1.4,
20422
+ transition: "border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease",
20423
+ "&:hover": { borderColor: "primary.main", bgcolor: "action.hover", boxShadow: 1, zIndex: 2 }
20424
+ },
20425
+ children: [
20426
+ failed ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20427
+ import_material35.Box,
20428
+ {
20429
+ sx: {
20430
+ width: 18,
20431
+ height: 18,
20432
+ borderRadius: "50%",
20433
+ bgcolor: "primary.main",
20434
+ color: "primary.contrastText",
20435
+ display: "grid",
20436
+ placeItems: "center",
20437
+ fontSize: 9,
20438
+ fontWeight: 700,
20439
+ flexShrink: 0
20440
+ },
20441
+ children: domain.charAt(0).toUpperCase()
20442
+ }
20443
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20444
+ import_material35.Box,
20445
+ {
20446
+ component: "img",
20447
+ src: `https://icons.duckduckgo.com/ip3/${domain}.ico`,
20448
+ alt: "",
20449
+ loading: "lazy",
20450
+ onError: () => setFailed(true),
20451
+ sx: { width: 18, height: 18, borderRadius: "50%", flexShrink: 0 }
20452
+ }
20453
+ ),
20454
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20455
+ import_material35.Box,
20456
+ {
20457
+ className: "chip-label",
20458
+ component: "span",
20459
+ sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
20460
+ children: label
20461
+ }
20462
+ )
20463
+ ]
20464
+ }
20465
+ )
20455
20466
  }
20456
- ) });
20467
+ );
20457
20468
  };
20458
20469
  SourceChips = ({ content }) => {
20459
20470
  const sources = (0, import_react43.useMemo)(() => parseWebSources(content), [content]);
20460
20471
  if (sources.length === 0) return null;
20461
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20462
- import_material35.Box,
20463
- {
20464
- sx: { display: "flex", flexWrap: "wrap", gap: 0.75, mt: 1.5 },
20465
- "aria-label": "Sources",
20466
- children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SourceChip, { source: s }, `${s.url}-${i}`))
20467
- }
20468
- );
20472
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_material35.Box, { sx: { display: "flex", alignItems: "center", gap: 0.75, mt: 1.5, flexWrap: "wrap" }, "aria-label": "Sources", children: [
20473
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20474
+ import_material35.Box,
20475
+ {
20476
+ component: "span",
20477
+ sx: {
20478
+ fontSize: 11,
20479
+ fontWeight: 700,
20480
+ color: "text.secondary",
20481
+ textTransform: "uppercase",
20482
+ letterSpacing: 0.5,
20483
+ flexShrink: 0
20484
+ },
20485
+ children: "Sources"
20486
+ }
20487
+ ),
20488
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20489
+ import_material35.Box,
20490
+ {
20491
+ sx: {
20492
+ display: "flex",
20493
+ alignItems: "center",
20494
+ flexWrap: "wrap",
20495
+ rowGap: 0.5,
20496
+ // Touch / no-hover devices: chips stay expanded (no hover to reveal).
20497
+ "& .source-chip": { ml: "4px" },
20498
+ "& .source-chip:first-of-type": { ml: 0 },
20499
+ "& .chip-label": { maxWidth: 200, opacity: 1, ml: 0.6 },
20500
+ // Hover-capable devices: collapse into an overlapping favicon stack
20501
+ // that spreads out and reveals titles when the rail is hovered.
20502
+ "@media (hover: hover)": {
20503
+ "& .source-chip": { ml: "-10px", transition: "margin-left 0.22s ease" },
20504
+ "& .source-chip:first-of-type": { ml: 0 },
20505
+ "& .chip-label": {
20506
+ maxWidth: 0,
20507
+ opacity: 0,
20508
+ ml: 0,
20509
+ transition: "max-width 0.28s ease, opacity 0.18s ease, margin-left 0.2s ease"
20510
+ },
20511
+ "&:hover .source-chip": { ml: "6px" },
20512
+ "&:hover .source-chip:first-of-type": { ml: 0 },
20513
+ "&:hover .chip-label": { maxWidth: 200, opacity: 1, ml: 0.6 }
20514
+ }
20515
+ },
20516
+ children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SourceChip, { source: s }, `${s.url}-${i}`))
20517
+ }
20518
+ )
20519
+ ] });
20469
20520
  };
20470
20521
  source_chips_default = SourceChips;
20471
20522
  }
@@ -20575,7 +20626,7 @@ var init_chat_messages = __esm({
20575
20626
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
20576
20627
  StreamingMarkdown_default,
20577
20628
  {
20578
- content: isStreaming && isLast ? content : stripSourcesForDisplay(content),
20629
+ content: stripSourcesForDisplay(content),
20579
20630
  isStreaming: isStreaming && isLast,
20580
20631
  sources: sourceSummaries
20581
20632
  }