@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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-42X7ZU6O.mjs";
3
+ } from "./chunk-JOY64M5C.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-GQHA7AIS.mjs";
14
14
  import "./chunk-RUMVTVNM.mjs";
15
15
  import "./chunk-ZLXWNTFK.mjs";
16
16
  import "./chunk-L2EKYO4F.mjs";
@@ -20389,83 +20389,103 @@ 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
+ sx: {
20408
+ display: "inline-flex",
20409
+ alignItems: "center",
20410
+ flexShrink: 0,
20411
+ gap: 0.5,
20412
+ height: 26,
20413
+ px: 0.75,
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
+ component: "span",
20458
+ sx: { maxWidth: 150, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
20459
+ children: label
20460
+ }
20461
+ )
20462
+ ]
20463
+ }
20464
+ )
20455
20465
  }
20456
- ) });
20466
+ );
20457
20467
  };
20458
20468
  SourceChips = ({ content }) => {
20459
20469
  const sources = (0, import_react43.useMemo)(() => parseWebSources(content), [content]);
20460
20470
  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
- );
20471
+ 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: [
20472
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
20473
+ import_material35.Box,
20474
+ {
20475
+ component: "span",
20476
+ sx: {
20477
+ fontSize: 11,
20478
+ fontWeight: 700,
20479
+ color: "text.secondary",
20480
+ textTransform: "uppercase",
20481
+ letterSpacing: 0.5,
20482
+ flexShrink: 0
20483
+ },
20484
+ children: "Sources"
20485
+ }
20486
+ ),
20487
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material35.Box, { sx: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 0.75 }, children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SourceChip, { source: s }, `${s.url}-${i}`)) })
20488
+ ] });
20469
20489
  };
20470
20490
  source_chips_default = SourceChips;
20471
20491
  }
@@ -20575,7 +20595,7 @@ var init_chat_messages = __esm({
20575
20595
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
20576
20596
  StreamingMarkdown_default,
20577
20597
  {
20578
- content: isStreaming && isLast ? content : stripSourcesForDisplay(content),
20598
+ content: stripSourcesForDisplay(content),
20579
20599
  isStreaming: isStreaming && isLast,
20580
20600
  sources: sourceSummaries
20581
20601
  }