@webless/agent 0.9.1 → 0.9.3

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/embed.cjs CHANGED
@@ -4800,6 +4800,20 @@ function InteractiveBookingCard({
4800
4800
 
4801
4801
  // src/react/components/MessageBubble/MessageBubble.tsx
4802
4802
  var import_streamdown = require("streamdown");
4803
+
4804
+ // src/react/lib/resolve-message-url.ts
4805
+ function resolveMessageUrl(safeUrl, baseUrl) {
4806
+ if (!safeUrl || !baseUrl) return safeUrl;
4807
+ try {
4808
+ const base = new URL(baseUrl);
4809
+ if (base.protocol !== "https:" && base.protocol !== "http:") return "";
4810
+ return new URL(safeUrl, base).href;
4811
+ } catch {
4812
+ return "";
4813
+ }
4814
+ }
4815
+
4816
+ // src/react/components/MessageBubble/MessageBubble.tsx
4803
4817
  var import_styles = require("streamdown/styles.css");
4804
4818
  var import_jsx_runtime7 = require("react/jsx-runtime");
4805
4819
  function normalizeDedupeText(text2) {
@@ -4842,6 +4856,7 @@ function MessageBubble({
4842
4856
  brandLogoUrl,
4843
4857
  bookingDisabled = false,
4844
4858
  bookingReadOnly = false,
4859
+ linkBaseUrl,
4845
4860
  offer,
4846
4861
  onBook
4847
4862
  }) {
@@ -4874,6 +4889,10 @@ function MessageBubble({
4874
4889
  isAnimating: isStreaming,
4875
4890
  linkSafety: { enabled: false },
4876
4891
  mode: isStreaming ? "streaming" : "static",
4892
+ urlTransform: (url, key, node) => resolveMessageUrl(
4893
+ (0, import_streamdown.defaultUrlTransform)(url, key, node) ?? "",
4894
+ key === "href" ? linkBaseUrl : void 0
4895
+ ),
4877
4896
  skipHtml: true,
4878
4897
  children: displayText
4879
4898
  }
@@ -4891,7 +4910,8 @@ function MessageBubble({
4891
4910
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: citation.label })
4892
4911
  ] }) }, citation.id)) }) : null
4893
4912
  ] });
4894
- if (!displayText && !message.searchResults?.length && offers.length === 0) return null;
4913
+ if (!displayText && !message.searchResults?.length && offers.length === 0)
4914
+ return null;
4895
4915
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { className: "message-bubble message-bubble--agent", children: [
4896
4916
  displayText || message.searchResults?.length ? showBrandLogo ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "message-bubble__agent-row", children: [
4897
4917
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "message-bubble__agent-avatar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(